“Porting” vs “Cross-compiling”

221 viewsOtherTechnology

Hey all,

Would someone help me understand the difference between “porting” and “cross-compiling”? I did some googling and YouTubing but it seems some people don’t make a distinction, some do, and some talk about crossing to a different OS and some to a different chip architecture.

PS: I have also read that porting/cross-compiling takes a very long time and can be a hard task – apparently Google Chrome and Firefox both have assembly in them but why was it so important to put assembly in them? It has to be super important given that they knew it would take a long time to port/cross compile to a different chip than the original one right?!

Thanks so much!

Thanks!!

In: Technology

6 Answers

Anonymous 0 Comments

>the difference between “porting” and “cross-compiling”? 

Cross compiling is specifically when you use one computer to compile code for a different computer. One where the code can’t run on the one compiling it.

Porting would be getting code written for one computer/platform/whatever and getting it to run on something else. 

You can take some Linux source code, work on it on a Windows box and change enough to get it to run. That’s porting without cross compiling. 

You can also take some Linux code, work on it within Linux and compile with gcc targeting windows, or embedded devices, or toothbrushes,  and get it to run on those. That’s porting with cross compiling. 

And embedded devs regularly cross-compile code that was never meant to run anywhere else. Cross-compiling without porting. 

You are viewing 1 out of 6 answers, click here to view all answers.