How to Compile 32-bit on a 64-bit Architecture Ubuntu Linux System

Can Özkan
May 14, 2023

Dear reader,

It’s been a long time since I wrote. I am currently dealing with my Ph.D. journey (my 9th-month evaluation is at the door); nonetheless, I plan to publish regularly from now on.

I’d like to discuss how to compile 32-bit on a 64-bit Ubuntu Linux (22.04) system. You may want this for a couple of reasons, and my main reason is that I will reverse engineer all the C/C++ programs I write in 32-bit architecture so that I can keep improving my reverse engineering skills.

The command that you need to issue is the following;

sudo apt-get install gcc-multilib

Upon successful installation, you can compile your C/C++ programs in 32-bit architecture by issuing the following command.

gcc -m32 <source_c_file.c> -o <output_program_name>

Thanks for reading.

Can

--

--

Can Özkan

Security Researcher, Penetration Tester, and Reverse Engineer