Recent

Author Topic: executable size differs after Compile and Build  (Read 3683 times)

mm7

  • Full Member
  • ***
  • Posts: 193
  • PDP-11 RSX Pascal, Turbo Pascal, Delphi, Lazarus
executable size differs after Compile and Build
« on: June 13, 2020, 08:39:58 pm »
If I Build, executable size is 52 MB.
If I Compile after this, executable size is 48 MB.

The only difference is "-B" (Build all modules) for Build.
Does it mean Compile does not link modules that have been built before?

In doc https://edoras.sdsu.edu/doc/fpc/user.pdf, pg 28 stated:
Quote
-B Re-compile all used units, even if the unit sources didn’t change since the last compilation.

so, what is not included into Compiled executable?

Linux, FPC 3.0.4



 

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: executable size differs after Compile and Build
« Reply #1 on: June 13, 2020, 08:47:12 pm »
Have you tried that using a External Debug file?
The only true wisdom is knowing you know nothing

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: executable size differs after Compile and Build
« Reply #2 on: June 13, 2020, 09:57:50 pm »
Perhaps your Build command does not include smartlinking, but your Compile command does?

mm7

  • Full Member
  • ***
  • Posts: 193
  • PDP-11 RSX Pascal, Turbo Pascal, Delphi, Lazarus
Re: executable size differs after Compile and Build
« Reply #3 on: June 13, 2020, 11:22:56 pm »
> Have you tried that using a External Debug file?

yes, the difference is in the External Debug file
but, why?

> Perhaps your Build command does not include smartlinking, but your Compile command does?

Again, I've compared the commands. The only difference is -B.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5481
  • Compiler Developer
Re: executable size differs after Compile and Build
« Reply #4 on: June 14, 2020, 11:11:32 am »
You can add the -Xm option to get a map file that contains a listing of everything that is contained. You can then compare the two files to see what gets left out.

mm7

  • Full Member
  • ***
  • Posts: 193
  • PDP-11 RSX Pascal, Turbo Pascal, Delphi, Lazarus
Re: executable size differs after Compile and Build
« Reply #5 on: June 14, 2020, 04:59:01 pm »
I've added -Xm.
No .map generated.

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: executable size differs after Compile and Build
« Reply #6 on: June 14, 2020, 07:05:30 pm »
https://bugs.freepascal.org/view.php?id=33982

Support for generating map file under Linux OS was added recently to the trunk and probably merged to next release version (3.2.0) of FPC compiler. 3.0.4 doesn't have such functionality but maybe mm7 can add extra linker option (-k"-Map out.map") to generate it.

mm7

  • Full Member
  • ***
  • Posts: 193
  • PDP-11 RSX Pascal, Turbo Pascal, Delphi, Lazarus
Re: executable size differs after Compile and Build
« Reply #7 on: June 14, 2020, 11:55:18 pm »
got maps.
lots of differences there.
 
For example in build map there are more $_Ld123 records
Code: Pascal  [Select][+][-]
  1. grep '\$_Ld[0-9]\+' out.map.cmp | wc -l
  2. 137536
  3.  
  4. grep '\$_Ld[0-9]\+' out.map.bld | wc -l
  5. 146786
  6.  

mm7

  • Full Member
  • ***
  • Posts: 193
  • PDP-11 RSX Pascal, Turbo Pascal, Delphi, Lazarus
Re: executable size differs after Compile and Build
« Reply #8 on: June 16, 2020, 05:25:03 pm »
So, why debug info would be different?

 

TinyPortal © 2005-2018