How to manually build the .exe using AS and LD ? lazarus / 62-General ---------------------------------------------------------------------- 440bx · 2021-05-10 04:43 Hello, First, this is _mostly_ for self education. After telling FPC to produce an assembly file, I'd like to use the assembler (AS) and linker (LD) to _manually_ create the executable. Any guidance on how this can be done with both, 64bit and 32bit executables (hopefully it can be done), will be greatly appreciated.  If there is a writeup on how to do this, a link to it would be great. Thank you for your help. ---------------------------------------------------------------------- Leledumbo · 2021-05-10 05:25 Quote from: 440bx on May 10, 2021, 06:43:11 amHello, First, this is _mostly_ for self education. After telling FPC to produce an assembly file, I'd like to use the assembler (AS) and linker (LD) to _manually_ create the executable. Any guidance on how this can be done with both, 64bit and 32bit executables (hopefully it can be done), will be greatly appreciated.  If there is a writeup on how to do this, a link to it would be great. Thank you for your help. Compile with -s, you will get ppas.sh. The required as and ld commands will be there unless internal assembler/linker is used. ---------------------------------------------------------------------- 440bx · 2021-05-10 05:54 Quote from: Leledumbo on May 10, 2021, 07:25:23 amCompile with -s, you will get ppas.sh. The required as and ld commands will be there unless internal assembler/linker is used. Thank you Leledumbo.  That's great, I'm going to carefully study the entire process. ---------------------------------------------------------------------- Jonas Maebe · 2021-05-10 17:36 Small addition: if you use "-s", the compiler will always switch to an external assembler. And if you add "-a", then the generated shell script for assembling/linking won't delete the assembler files once it's done. ---------------------------------------------------------------------- 440bx · 2021-05-10 17:55 Quote from: Jonas Maebe on May 10, 2021, 07:36:38 pmSmall addition: if you use "-s", the compiler will always switch to an external assembler. And if you add "-a", then the generated shell script for assembling/linking won't delete the assembler files once it's done. Thank you Jonas.  I did notice that.  I am using -al.  Should I be using -a instead ? ---------------------------------------------------------------------- Jonas Maebe · 2021-05-10 18:01 -al is a superset of -a, so it's fine. ---------------------------------------------------------------------- 440bx · 2021-05-10 18:33 Quote from: Jonas Maebe on May 10, 2021, 08:01:30 pm-al is a superset of -a, so it's fine. Thank you Jonas.