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
^
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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
Folks,
I've a bare bone XPC Service, built with Xcode 12.x.
I can get it work under Xcode interactive debugger. But from command line I get the Illegal instruction.
A similar project with XPC client don't see the problem.
Any help ?
Eventually it would be part of launchctl based daemon
TIA
-P
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
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