SilianRail
SilianRail

Reputation: 29

How to use lipo to convert c++ output file from arm64 to x86_32/ x86_64

I started programming with c++ since a while but was using Xcode only or terminal occasionally to compile my .cpp file. Recently, our instructor suggested we use Valgrind for memory leaks but I figured Valgrind was unavailable for my M2 Mac.

So, upon asking for alternative, I was suggested Dr. Memory. Now, while installing and setting up Dr. Memory, I came across this step mentioned to set up my application for drmemory to run a chekck. Image of the step listed in the dr. memory website

link to original website The code to be executed looks as follows but produces error- c++ -m32 -g -fno-inline -fno-omit-frame-pointer linkedlist.cpp -o myapp

The error is the following- ld: unknown/unsupported architecture name for: -arch armv4t clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am assuming this is particularly because of the -m32 command because Xcode command line tools doesn't support 32 bit/64 bit x86 compilation. So, I set out to convert my output file(arm64) to x86_64 / x86_32 for using dr. memory command.

To solve this, I added the following command to my make file- -arch x86_64 which seems to create an x86_64 executable file.

Now, I don't understand whenever I use the command mentioned in their website /Users/name/Documents/DrMemory-MacOS-2.5.0/bin/valgrind2drmemory.pl -- ./linkedlist out, I get the following output - Converted 0 suppressions Had problems with 0 frames and the output file out has nothing in it.

I am really confused what to do now. Need help!

Upvotes: 0

Views: 148

Answers (0)

Related Questions