1

Sometimes in s/w companies, customers provide data in multiple formats. There are linkable and executable data that are said to be "Rehosted" and compiled object files that are said to be "Retargeted". I am trying to understand what rehosting and retargeting mean in this area. Is it similar to the Bootstrap theory in computer science? I have the understanding of the following process (if not incorrect):

PROBLEM:

I need to write a compiler for a new language called "MyLang" to run on PowerPC

Solution:

1. I need to write a compiler for a language "MyLang-Mini"; a subset of "MyLang" to run on PowerPC. 


2. I need to write a compiler for "MyLang" using "MyLang-Mini" to run on PowerPC.

3. I run the compiler obtained from no. 1 through the compiler obtained from no. 2 to  
   obtain the compiler for MyLang to run on PowerPC.

IN BESPOKE "T" DIAGRAM (...ISH):

MyLang      PowerPC                                MyLang              PowerPC
      MyLangMini      MyLangMini           PowerPC       PowerPC(instr.) 
                             PowerPC(instr.)

What I am getting confused about is rehosting and retargeting. How are they coonected to this concept? What am I rehosting and retargeting if I have some binary data such as .exe or .obj? I would appreciate some detailed explanation if possible please!

I know that this will embark onto "CROSS-COMPILERS", but would prefer expert opinions to be sure.

Thanks in advance.

Siguza
  • 21,155
  • 6
  • 52
  • 89
ha9u63a7
  • 6,233
  • 16
  • 73
  • 108

1 Answers1

1

I now know that in s/w engineering:

REHOSTING - If you have a third-party application linkable/executable that requires usage on your host machine, you do rehosting. The target in this case are most often the same (OS platform, processor, etc.). In worst case, there is a virtualisation required. The rehosted application will run as if it was one of the application running in the host machine

RETARGETTING - If you have a third-party source code, you might need to recompile that to match with your target environment. It may also be that you have third-party .o or .obj compiled models and you want to link them with your source code (retargeted) in order to host it on a host machine. Just like REHOSTED application, it will be as if the application was installed on the host machine.

It will be good to know how this is similar to the compiler rehosting and retargeting. Sorry, I am a newbee is this area and will appreciate even a slap on the wrist.

ha9u63a7
  • 6,233
  • 16
  • 73
  • 108