Post

Replies

Boosts

Views

Activity

ARM64 bit file with C files Xcode compile
Hi All, Instead of using embedded asm ( __asm), how could I write a arm64.s file and integrate to a command line test project with c files ? #include <stdio.h> extern int myadd(int a, int b); int main(int argc, const char * argv[]) { // insert code here... printf("Hello, World!\n"); int r = myadd( 10 , 4); return 0; } And .s file .global myadd .p2align 2 .type myadd,%function myadd: // Function "myadd" entry point. .fnstart add r0, r0, r1 // Function arguments are in R0 and R1. Add together // and put the result in R0. bx lr // Return by branching to the address in the link // register. .fnend Error -- /Users/prokashsinha/Arm/ArmAndC/asmfunction.s:9:1: error: unknown directive .type myadd,%function ^ /Users/prokashsinha/Arm/ArmAndC/asmfunction.s:12:1: error: unknown directive .fnstart ^ /Users/prokashsinha/Arm/ArmAndC/asmfunction.s:13:5: error: invalid operand for instruction add r0, r0, r1 ^ /Users/prokashsinha/Arm/ArmAndC/asmfunction.s:15:1: error: unrecognized instruction mnemonic, did you mean: b, bcax, bl, br, sb, tbx? bx lr ^ /Users/prokashsinha/Arm/ArmAndC/asmfunction.s:17:1: error: unknown directive .fnend ^
1
0
679
Aug ’23
Link problem when class members are defined in cpp file for dynamic lib
Folks I'm trying to handle a linking problem coming out of linking a command line app to a c++ based library. But if I defined those methods inline with the class definition, no problem is there ... Problem shows -- Ld Build/Products/Debug/COMM_Srv normal x86_64     cd /Users/prokash.sinha/mysrc/C++/COMM_Srv     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-macos11.3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -L/Users/prokash.sinha/mysrc/C++/COMM_Srv/Build/Products/Debug -L/Users/prokash.sinha/mysrc/C++/COMM-BUS/Build/Products/Debug -F/Users/prokash.sinha/mysrc/C++/COMM_Srv/Build/Products/Debug -filelist /Users/prokash.sinha/mysrc/C++/COMM_Srv/Build/Intermediates.noindex/COMM_Srv.build/Debug/COMM_Srv.build/Objects-normal/x86_64/COMM_Srv.LinkFileList -Xlinker -object_path_lto -Xlinker /Users/prokash.sinha/mysrc/C++/COMM_Srv/Build/Intermediates.noindex/COMM_Srv.build/Debug/COMM_Srv.build/Objects-normal/x86_64/COMM_Srv_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -stdlib=libc++ -v -lCOMM-BUS -Xlinker -dependency_info -Xlinker /Users/prokash.sinha/mysrc/C++/COMM_Srv/Build/Intermediates.noindex/COMM_Srv.build/Debug/COMM_Srv.build/Objects-normal/x86_64/COMM_Srv_dependency_info.dat -o /Users/prokash.sinha/mysrc/C++/COMM_Srv/Build/Products/Debug/COMM_Srv Apple clang version 12.0.5 (clang-1205.0.22.11) Target: x86_64-apple-macos11.3 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin  "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 11.3.0 11.3 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -o /Users/prokash.sinha/mysrc/C++/COMM_Srv/Build/Products/Debug/COMM_Srv -L/Users/prokash.sinha/mysrc/C++/COMM_Srv/Build/Products/Debug -L/Users/prokash.sinha/mysrc/C++/COMM-BUS/Build/Products/Debug -filelist /Users/prokash.sinha/mysrc/C++/COMM_Srv/Build/Intermediates.noindex/COMM_Srv.build/Debug/COMM_Srv.build/Objects-normal/x86_64/COMM_Srv.LinkFileList -object_path_lto /Users/prokash.sinha/mysrc/C++/COMM_Srv/Build/Intermediates.noindex/COMM_Srv.build/Debug/COMM_Srv.build/Objects-normal/x86_64/COMM_Srv_lto.o -export_dynamic -no_deduplicate -lCOMM-BUS -dependency_info /Users/prokash.sinha/mysrc/C++/COMM_Srv/Build/Intermediates.noindex/COMM_Srv.build/Debug/COMM_Srv.build/Objects-normal/x86_64/COMM_Srv_dependency_info.dat -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/lib/darwin/libclang_rt.osx.a -F/Users/prokash.sinha/mysrc/C++/COMM_Srv/Build/Products/Debug Undefined symbols for architecture x86_64:   "TCPStream::s_send(char*, long)", referenced from:       _main in main.o   "TCPStream::receive(char*, long)", referenced from:       _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) nm on the lib -- bash-3.2$ nm Products/Debug/libCOMM-BUS.dylib | grep TCPStream 0000000000003710 T __ZN9TCPStream6s_sendEPcl 00000000000037a0 T __ZN9TCPStream7receiveEPcl 0000000000003660 T __ZN9TCPStreamC1EiP11sockaddr_un 00000000000035a0 T __ZN9TCPStreamC2EiP11sockaddr_un 00000000000036f0 T __ZN9TCPStreamD1Ev 0000000000003690 T __ZN9TCPStreamD2Ev Constructor and Destructor defines are fine in the cpp file. The s_send and receive methods are not like one or two liners, so was trying to put them in C++ implementation files. Is there something more I need in terms of linking ? TIA -P
1
0
845
Sep ’21
Notarize problem
Uploading package to notarization service....2021-05-19 15:22:16.163 altool[2746:1769840] CFURLRequestSetHTTPCookieStorageAcceptPolicy_block_invoke: no longer implemented and should not be called 2021-05-19 15:22:17.261 altool[2746:1769831] * Error: Unable to notarize app. 2021-05-19 15:22:17.261 altool[2746:1769831] * Error: code -1011 (Failed to authenticate for session: (     "Error Domain=ITunesConnectionAuthenticationErrorDomain Code=-22938 \"Sign in with the app-specific password you generated. If you forgot the app-specific password or need to create a new one, go to appleid.apple.com\" UserInfo={NSLocalizedRecoverySuggestion=Sign in with the app-specific password you generated. If you forgot the app-specific password or need to create a new one, go to appleid.apple.com, NSLocalizedDescription=Sign in with the app-specific password you generated. If you forgot the app-specific password or need to create a new one, go to appleid.apple.com, NSLocalizedFailureReason=App Store operation failed.}" ) Unable to upload your app for notarization.) Upload failed, please review the error log printed above Not clear, what went wrong , in this process
3
0
2.1k
May ’21
os_log
On 11.3 and 11.4 I see some of the log entries are missing when using os_log(Default, "...."); Wondering if there is a configuration param I should use. Also does it matter, if I have my own serial and concurrent queues ( 'm not worried about the sequence of the print, just that will it print into log , so some form of $ low collect I can use) Thanks, Prokash
1
0
1.2k
Apr ’21
Big Sur beta (latest ) CSRUTIL
Is csrutil broken now ? Was trying to disable it, to clean up some SystemExtensions from the file system... It went okay. But reboot does not let me login.... Its spins ... If I try to put back to enable ( Cmd + R key ) it does not get to recovery mode. So I can not get back to where I was
1
0
743
Nov ’20
How to map KAUTH_VNODE_READ_ATTRIBUTES to current attribute list
Folks, We had a kext, where I handled KAUTHVNODEREADATTRIBUTES using VNODE listener to capture CD/DVD activities. Context:: We used to get an unique event for KAUTHVNODEREADATTRIBUTES, when a file / doc is copied to CDROM ( and the system creates an Alias )... When I map this to ESEVENTTYPEAUTHGETATTRLIST, I get about 8 or so events in this auth type. File attributes are 1 or 0, except one more value ( it looks like pid ) How am I going to map to a single event? The action we want to take is once per file/doc. But where can we get some detail about these events ( of same event type ), so we can isolate one from other ... TAI,Pro
1
0
673
Sep ’20
External Dylib load failing
Hi, I've an Application Bundled and signed from the Xcode signature options ( runtime hardening is disabled ). The Application has a provisioning profile with Apple. We do have dylibs on different workspace/projet that we include in the Framework, library dependencies on link modules. We tried to disable library-validation using the Xcode option switch. But it always fails with CODESIGNING, Code 0x2 Following is the code signature of the Bundled App - Identifier=com.forcepoint.ep.ESDaemonBundle Format=app bundle with Mach-O thin (x8664) CodeDirectory v=20200 size=1312 flags=0x0(none) hashes=33+5 location=embedded VersionPlatform=1 VersionMin=659200 VersionSDK=659204 Hash type=sha256 size=32 CandidateCDHash sha256=6036f59a3467b84e3195fb59424a08fd0c738716 CandidateCDHashFull sha256=6036f59a3467b84e3195fb59424a08fd0c738716b6414171f908486a4e33446b Hash choices=sha256 CMSDigest=6036f59a3467b84e3195fb59424a08fd0c738716b6414171f908486a4e33446b CMSDigestType=2 Page size=4096 CDHash=6036f59a3467b84e3195fb59424a08fd0c738716 Signature size=4657 Authority=Developer ID Application: WEBSENSE, INC. (C489D5E8E8) Authority=Developer ID Certification Authority Authority=Apple Root CA Signed Time=Aug 18, 2020 at 11:18:30 AM Info.plist entries=19 TeamIdentifier=C489D5E8E8 Sealed Resources version=2 rules=13 files=1 Internal requirements count=1 size=224 Following is the library signature -- Executable=/Users/mani/GITS/epm-f1e/build/libMsgCom.dylib Identifier=libMsgCom Format=Mach-O thin (x8664) CodeDirectory v=20200 size=553 flags=0x0(none) hashes=13+2 location=embedded Hash type=sha256 size=32 CandidateCDHash sha256=db2c196b6d8bdf469968679e7f94a85a5750bea1 CandidateCDHashFull sha256=db2c196b6d8bdf469968679e7f94a85a5750bea1f550b6acedbb1c3d26865545 Hash choices=sha256 CMSDigest=db2c196b6d8bdf469968679e7f94a85a5750bea1f550b6acedbb1c3d26865545 CMSDigestType=2 CDHash=db2c196b6d8bdf469968679e7f94a85a5750bea1 Signature size=4657 Authority=Developer ID Application: WEBSENSE, INC. (C489D5E8E8) Authority=Developer ID Certification Authority Authority=Apple Root CA Signed Time=Aug 18, 2020 at 10:21:51 AM Info.plist=not bound TeamIdentifier=C489D5E8E8 Sealed Resources=none Internal requirements count=1 size=204. Any help would be much appreciated. Any links or books that explains all of these would be great too ! Thanks much, Prokash
1
0
1k
Aug ’20