Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-07

A small wish for FPC

7 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik

Hi all,

I have a "small" wish regarding the ability to work with FPC...

At the moment, if I'm using SysUtils, then it also adds all the resource string regardless if I'm using it or not.

At the end parts of the executable have a lot more content of things existed in units that I do not use, and sometimes even more then my own code.

The best idea I have to solve such thing is to use some sort of instructions for the compiler to tell it what I do need, and the compiler will check dependencies if there is a problem with my choice.

What do you think on this idea and issue ?

ido

Reply by email

Daniël Mantione
to ik

Op Thu, 27 Jul 2006, schreef ik:

Show quoted text 14 lines
I have a "small" wish regarding the ability to work with FPC... At the moment, if I'm using SysUtils, then it also adds all the resource string regardless if I'm using it or not. At the end parts of the executable have a lot more content of things existed in units that I do not use, and sometimes even more then my own code. The best idea I have to solve such thing is to use some sort of instructions for the compiler to tell it what I do need, and the compiler will check dependencies if there is a problem with my choice. What do you think on this idea and issue ?

Well, the current 2.1 compiler has an internal linker which allowed it to be made smarter what can be removed. It doesn't include the resource strings in the executable anymore. However, sysutils remains a heavy unit.

Daniël

Reply by email

Michael Van Canneyt
to ik: I have a "small" wish regarding the ability to work with FPC... At the moment, if I'm…
ik wrote 14 lines
Hi all, I have a "small" wish regarding the ability to work with FPC... At the moment, if I'm using SysUtils, then it also adds all the resource string regardless if I'm using it or not. At the end parts of the executable have a lot more content of things existed in units that I do not use, and sometimes even more then my own code. The best idea I have to solve such thing is to use some sort of instructions for the compiler to tell it what I do need, and the compiler will check dependencies if there is a problem with my choice.

We are aware of this problem, and it is solved with the internal linker.

Michael.

Reply by email

ik
to Michael Van Canneyt
Michael Van Canneyt wrote 20 lines
On Thu, 27 Jul 2006, ik wrote: > Hi all, > > I have a "small" wish regarding the ability to work with FPC... > > At the moment, if I'm using SysUtils, then it also adds all the > resource string regardless if I'm using it or not. > > At the end parts of the executable have a lot more content of things > existed in units that I do not use, and sometimes even more then my > own code. > > The best idea I have to solve such thing is to use some sort of > instructions for the compiler to tell it what I do need, and the > compiler will check dependencies if there is a problem with my choice. We are aware of this problem, and it is solved with the internal linker.

Sounds cool :)
How do I use it in Linux (as far as I remember the linker only works on Windows at the moment ?)

Michael.

Ido

Reply by email

Peter Vreman
to ik
Show quoted text 9 lines
> > The best idea I have to solve such thing is to use some sort of > > instructions for the compiler to tell it what I do need, and the > > compiler will check dependencies if there is a problem with my choice. > > We are aware of this problem, and it is solved with the internal linker. Sounds cool :) How do I use it in Linux (as far as I remember the linker only works on Windows at the moment ?)

You can't. It is only supports the Windows targets.

Reply by email

Daniel Franzini
to Peter Vreman

i'm sorry my lack of deeper knowledge...but can't strip solve the problem?!?!?!?

Peter Vreman wrote 21 lines
>> > The best idea I have to solve such thing is to use some sort of >> > instructions for the compiler to tell it what I do need, and the >> > compiler will check dependencies if there is a problem with my choice. >> >> We are aware of this problem, and it is solved with the internal linker. > > Sounds cool :) > How do I use it in Linux (as far as I remember the linker only works > on Windows at the moment ?) You can't. It is only supports the Windows targets. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel
Daniel "Let us change our traditional attitude to the construction of programs. Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do." (Donald Knuth) "Yes, technogeeks can be funny, even if only to each other." ( http://www.boogieonline.com/revolution/science/humor/)" "Man is driven to create; I know I really love to create things. And while I'm not good at painting, drawing, or music, I can write software." (Yukihiro Matsumoto, a.k.a. ``Matz'')

Reply by email

Marco van de Voort
to Daniel Franzini
i'm sorry my lack of deeper knowledge...but can't strip solve the problem?!?!?!?

No. Strip only removes debug code. Linkers can do elimination of unused symbols (structured constants, procedures and whole VMTs), but there is a problem if a set of symbols are referenced in a table, and the table is referenced itself.

Example: there are 1000 resourcestrings, and you only use one of them. Yet you use them via a table lookup with all thousand in them, so all are linked in. To remove entries from the table the linker must have a certain knowledge about table (e.g. when removing entries, adapt the indexes in the table used in the code)

If I understood Peter right, some support for this kind of stuff is also in LD, but not for all targets (binary formats) and it is convuluted and hard to use. With the internal linker it is way easier.

The same goes for elimination of unused VMT entries.

Reply by email