Post not yet marked as solved
Hi there.
I'm trying to run objc app with Iobfs4proxy framework.
I got such error.
ld: warning: directory not found for option '-F/Users/ivan/Projects/buddy-onion/Tob/../Carthage/Build/iOS'
ld: in /Users/ivan/Projects/buddy-onion/Tob/Iobfs4proxy.framework/Iobfs4proxy(go.o), section __TEXT/__text address out of range file '/Users/ivan/Projects/buddy-onion/Tob/Iobfs4proxy.framework/Iobfs4proxy' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Device: Air m1(2020)
OS: Monterey 12.2.1
XCode: 13.3
iOS: 15.3.1 (real device)
Post not yet marked as solved
Hello,
I faced a weird problem with my framework imported into my app. MyFramework uses some other frameworks like OpenSSL etc. I build MyFramework with the script:
FrameworkName="MyFramework"
rm -rf build/
xcodebuild archive -scheme "$FrameworkName" \
-configuration Debug -destination 'generic/platform=iOS' \
-archivePath "./build/$FrameworkName.framework-iphoneos.xcarchive" \
SKIP_INSTALL=NO \
BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
xcodebuild archive -scheme "$FrameworkName" \
-configuration Debug -destination 'generic/platform=iOS Simulator' \
-archivePath "./build/$FrameworkName.framework-iphonesimulator.xcarchive" \
SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
xcodebuild archive -scheme "$FrameworkName" \
-configuration Debug -destination 'generic/platform=macOS' \
-archivePath "./build/$FrameworkName.framework-macos.xcarchive" \
SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
# Fix https://bugs.swift.org/browse/SR-14195 (caused by https://bugs.swift.org/browse/SR-898)
pattern="./build/$FrameworkName.framework-iphoneos.xcarchive/Products/Library/Frameworks/$FrameworkName.framework/Modules/$FrameworkName.swiftmodule/*.swiftinterface"
grep -rli "$FrameworkName.$FrameworkName" $pattern \
| xargs sed -i '' "s,$FrameworkName.$FrameworkName,$FrameworkName,g"
# end fix
xcodebuild -create-xcframework \
-framework "./build/$FrameworkName.framework-iphoneos.xcarchive/Products/Library/Frameworks/$FrameworkName.framework" \
-framework "./build/$FrameworkName.framework-iphonesimulator.xcarchive/Products/Library/Frameworks/$FrameworkName.framework" \
-framework "./build/$FrameworkName.framework-macos.xcarchive/Products/Library/Frameworks/$FrameworkName.framework" \
-output "./build/$FrameworkName.xcframework"
# Wait for process completion and verify result
pid=$!
wait $pid
echo "Process with PID $pid has finished with Exit status: $?"
[[ ! -d "./build/$FrameworkName.xcframework/" ]] && {
msg="[ERROR] expected ./build/$FrameworkName.xcframework/ to exist"; echo -e $msg
exit 1
}
As you can see, it is also built framework for the macOS platform.
A little digression: I prefer using Carthage to build xcframeworks, but here it doesn't work, I don't the reason.
The aforementioned build solution works great, all frameworks included in MyFramework don't have any issues when I use MyFramework in my iOS App. The problem starts with using MyFramework in macOS target App. It shows two related errors, I tried some solutions but didn't find a proper way... Errors:
blablabla/DerivedData/MyApp-hdzvzxtsnsdivzcialzikxjdwidw/Build/Products/Debug/MyFramework.framework/Modules/MyFramework.swiftmodule/arm64-apple-macos.swiftinterface:9:8: error: no such module 'OpenSSL'
import OpenSSL
And the second one:
blablabla/Helpers/Injected/Services.swift:10:8: error: failed to build module 'MyFramework' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
import MyFramework
I can import the OpenSSL framework to the macOS app and then I faced the same problem with the next framework from MyFramework's importing list - it isn't a solution...
What causes that problem?
Thanks in advance for any help... 🥺
Post not yet marked as solved
Hi,
When debugging an iOS AUv3 extension in GarageBand (or in other host apps) on Mac OS Monterey running on an M1 Mac, there is a large number of warnings that read:
WARNING: SPI usage of '-[UINSWindow uiWindows]' is being shimmed. This will break in the future. Please file a radar requesting API for what you are trying to do.
I noticed that immediately after such a warning, the view's hitTest is called with a UIHoverEvent, and indeed moving the mouse results in more log spam. Although the very first occurrence of the warning may have a different root cause. Using a symbolic breakpoint wasn't helpful in revealing further information.
Note that I'm launching the AUv3 extension in the "Designed for iPad" mode. Project language is Objective-C. I was able to reproduce the issue with even an empty project, adding nothing beyond Xcode's built-in appex template for iOS Audio Units.
The issue doesn't seem to happen with the Apple sample code "CreatingCustomAudioEffects", which is a swift project. I also compared and matched storyboard settings between that project and my own, but to no avail.
Any pointers would be highly appreciated.
Thanks.
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?
Post not yet marked as solved
I have an application made for iPhone and iPad with enabled capability to run natively on M1 Macs.
When I try to resign it with an AdHoc profile:
codesign --force --deep -s - MyApp.app
Application can not be launched anymore with error:
"MyApp.app" cannot be opened because the developer did not intend for it to run on this Mac. Contact the developer for support.
Is there way to resign it without loosing an ability to run on M1 Mac?
Thanks!
Post not yet marked as solved
Hi, I am looking for the way to achieve the same effect as Linux system call membarrier [1] on Apple Silicon Mac. The syscall issues memory barriers on the other threads. Windows has the similar function FlushProcessWriteBuffers [2]. Is there an equivalent function?
[1] https://man7.org/linux/man-pages/man2/membarrier.2.html
[2] https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-flushprocesswritebuffers
On Intel machines, changing the memory page settings by mprotect system calls makes write buffers of other processors flushed, but it does not seem to work on Apple Silicon.
Post not yet marked as solved
I know as of macOS 11.1 it is now possible to run your iOS/iPadOS apps in fullscreen on silicon Macs. Though I couldn't find anything online of how to do this. How would I go about making my app compatible?
Post not yet marked as solved
how to disable eagle mode in enabling gpu on Mac m1
Post not yet marked as solved
This might seem flippant, but it's very serious. My use case, this is literally torturing me to death:
We have a language (Allegro Common Lisp) which has a module for making SSL connections. This module is requires OpenSSL. We don't want to supply OpenSSL with our product for obvious reasons--I'm not going to go into that here.
So, what's the problem? Well, first, the problem is that Apple decided long ago to not allow developers to build against their version of SSL (which is based on LibreSSL). So, we must depend on Macports or Homebrew for the installation of OpenSSL. Those libraries are in non-standard places and require DYLD_LIBRARY_PATH to be set so that the libraries can be dynamically loaded.
The problem is, with SIP, any environment variables that start with DYLD_ or LD_ are stripped from the environment passed to programs. That is, if I set DYLD_LIBRARY_PATH in BASH and start my product, I can't load a signed .dylib that depends on some version of the OpenSSL libraries.
To make matters worse, this works on macOS 11.6.5 (20G527) x86_64:
DYLD_LIBRARY_PATH=... ./mlisp
(sys:getenv "DYLD_LIBRARY_PATH")`
That is, it returns the value ... set on the command line.
It does not work on macOS 11.6.5 (20G527) arm64.
To dynamically load the OpenSSL libraries, we have a glue library (that adds functionality) called acliss11.dylib which depends on @rpath/libssl.1.1.dylib and @rpath/libcrypto.1.1.dylib.
For x86_64 we have a solution, but the same solution does NOT work for arm64.
How are we supposed to do this?
I have a nodejs app, made into a single executable using pkg which signs the app with an ad-hoc signature. This single executable (xkeys-server-arm64)works fine on the machine which made it but fails on another machine of the same type - presumably because the ad-hoc signature is insufficient in this case.
I've tried to replace the ad-hoc signature with my own, using:
codesign --force --verify --verbose --sign "Developer ID Application: Christoph Willing (..........)" xkeys-server-arm64
but that fails with
xkeys-server-arm64: replacing existing signature
xkeys-server-arm64: errSecInternalComponent
Checking my own signature with:
find-identity -v -p appleID
shows a bunch of stuff which doesn't look good.
My Christoph_Willing_dev_CA entry says
(CSSMERR_TP_NOT_TRUSTED)
All other entries, including the Developer ID Application entry I'm trying to codesign with have the comment:
(Missing required extension)
My questions are:
what causes the errSecInternalComponent error (and how can I fix it)?
why isn't my dev_CA trusted (and how to fix)?
what are the missing extensions for the other certificates (and how to provide them)?
Thanks for any tips,
chris
I trying to build older version of python such as 3.6, 3.7, 3.8 using pyenv and having build failures. I am on apple silicon and the last macOS 12.3.1. In older OS these versions would build fine.
Following is the failure I get running pyenv install 3.6.9
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.6.9.tar.xz...
-> https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
Installing Python-3.6.9...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 12.3.1 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/sn/46fncn513kng4ssgwn398m5h0000gn/T/python-build.20220403110510.8666
Results logged to /var/folders/sn/46fncn513kng4ssgwn398m5h0000gn/T/python-build.20220403110510.8666.log
Last 10 log lines:
checking for --with-cxx-main=<compiler>... no
checking for clang++... no
configure:
By default, distutils will build C++ extension modules with "clang++".
If this is not intended, then set CXX on the configure command line.
checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report
make: *** No targets specified and no makefile found. Stop.
Post not yet marked as solved
I spent many hours to figure out why my app is now other item not the iOS app
you will see the Distribute Content instead of Distribute App
Version and Identifier are now gone
I test it on Xcode 13.3
the last archive you will see in the image is the one that Creation Date is 3 Apr 2022 17:55
I try to build with the previous version (Xcode 13.2.1)
The error appears Package.resolved file is corrupted or malformed
I delete the Package.resolved
Then the error is gone
I try to archive again and it works
Creation Date is 3 Apr 2022 18:30
The problem seems to occur when using an older Xcode project opened with the current version of Xcode (13.3).
Post not yet marked as solved
Hello! I have an app that was developed on intel mac using react-native, when developing on M1, the app "quits unexpectedly" on simulator but works fine if I plug my device.
Any idea?
Problem Details and System Configuration
Post not yet marked as solved
Today I was reminded that apps on the Mac do not have to be Mach-O Executables: They can be scripts!
For example, a python script.
But what I found out that if the app is started directly from the terminal, the app starts as ARM64. But if starting from the Finder (i.e. launchd), it is launched as Intel.
Is there an Info.plist key that fixes this?
Post not yet marked as solved
Hello,
is there something to do for developers for the M1 Ultra chip to use all GPU cores?
When you output the power used, you may see that with heavy load, the GPU may not use full 120 W of power and it looks like some GPU cores may be idle.
Is some entitlement needed, something for configuration?
Or how can you get maximum performance there?
Greetings
Christian
Post not yet marked as solved
I'm facing a weird situation. Everytime a try to dlopen my library the application totally freezes.
Does anyone have faced the same issue or have some suggestion?
Post not yet marked as solved
I am trying to run a computer graphics code which uses "glew", "OpenGL", "Glut" frameworks. My M1 Mac cannot see "glew" which I have downloaded using homebrew.
I dragged and dropped the libGLEW2.2.0.dylib under opt/homebrew/Cellar/lib... into the "Link with libraries" part of the Build Phases of my Xcode project.
I am getting the following error
dyld[23765]: Library not loaded: /opt/homebrew/opt/glew/lib/libGLEW.2.2.dylib
Can you please help me with this? the library is already loaded but Xcode cannot see it under the directories that it checks.
Post not yet marked as solved
Hi all,
so, in my app Transloader, when the app is terminated, I sync the Mac's "turned off" status to iCloud.
This works on Intel Macs and on Apple silicon Macs when the user manually quits the app.
However, on Apple silicon Macs, when the user shuts down or restarts the Mac and the app is terminated that way, the app is terminated right away (doesn't even receive the -applicationWillTerminate: call), so I'm unable to properly sync the status. This still works on Intel Macs, as far as I know.
So, is there any new API to extend the Mac's shutdown a little longer to finish my sync?
Currently, I use -applicationShouldTerminate:, returning NSTerminateLater, and after syncing, calling -replyToApplicationShouldTerminate:YES .
Again, this works fine on Intel Macs if the user manually quits, as well as if the Intel Mac shuts down, but on Apple silicon, it only works if the user manually quits - a shutdown results in the app being terminated without even receiving a -applicationWillTerminate: call.
Both NSSupportsSuddenTermination and NSSupportsAutomaticTermination are disabled in the app's Info.plist.
Thank you for any insights,
Matt
Post not yet marked as solved
When i compile the c program with mysql i get the next error:
ld: library not found for -lzstd
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So i use the zstd (that i installed) directory link in my command line
gcc parking.o -o parking.exe `mysql_config --libs` -L/opt/homebrew/Cellar/zstd/1.5.2/lib
It creates the .exe but when i launch it i get
How can i solve it ? Need help please.
Post not yet marked as solved
Currently testing our app's viability for running on native Apple Silicon and we're noticing that UIApplication.userDidTakeScreenshotNotification is not being invoked when taking a screenshot.
NotificationCenter.default.addObserver(self, selector: #selector(screenshotTaken), name: UIApplication.userDidTakeScreenshotNotification, object: nil)
Is there another API I should be using, or is this feature just not possible running on a mac?