FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bloated EXEs (reprise)
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Bloated EXEs (reprise)
Posted: Sat Jul 22, 2017 02:59 PM
Anybody could tell me why the following sample generates an EXE of 3208192 bytes?

Code (fw): Select all Collapse
FUNCTION MAIN()

    RETURN NIL


The same compiled with xHarbour console (without FWH) is 842240 bytes. The difference is surprisingly high.

EMG
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Bloated EXEs (reprise)
Posted: Sat Jul 22, 2017 05:52 PM

Which libs do you have included? I think the libraries full of functionality make the .exe bigger 8)

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bloated EXEs (reprise)
Posted: Sat Jul 22, 2017 06:02 PM

Only the standard libs: fivehx.lib and fivehc.lib. But please note that I make no call to any of the FWH functions or classes (see my sample). 2.4 MB size bigger is too much for doing nothing, isn't it?

EMG

Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Bloated EXEs (reprise)
Posted: Sat Jul 22, 2017 07:02 PM

It definitely are the fwh-libs. If I comment these file out of the samples buildx.bat, my .exe is 831kb, with these libs it is 3404kb.

The commented lines are:
echo %fwh%\lib\Fivehx.lib %fwh%\lib\FiveHC.lib %fwh%\lib\libmysql.lib + >> b32.bc
echo %fwh%\lib\pgsql.lib %hdir%\lib\libpq.lib + >> b32.bc

So, as long as you don't need functionality provided by these libs, you can keep them out of the compiling.

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bloated EXEs (reprise)
Posted: Sat Jul 22, 2017 08:35 PM

Gilbert,

you definitely missed the point. As the linker put a module in the EXE only if at least one of the symbols contained in that module is referenced, why we have 2.4 MB of modules linked to the EXE if it's only an empty program?

EMG

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bloated EXEs (reprise)
Posted: Sun Jul 23, 2017 06:44 AM

Enrico,

Comparing the generated .map files we can see which modules are getting linked into the EXE

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bloated EXEs (reprise)
Posted: Sun Jul 23, 2017 08:33 AM

Antonio,

thank you. I just send the map to your private email. Any thoughts?

EMG

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bloated EXEs (reprise)
Posted: Sun Jul 23, 2017 03:29 PM

Enrico,

Please don't link FWH libraries and check the EXE size that you get

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bloated EXEs (reprise)
Posted: Sun Jul 23, 2017 03:42 PM

829440 bytes

EMG

Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Bloated EXEs (reprise)
Posted: Sun Jul 23, 2017 05:31 PM

Enrico,

sorry, I assumed the key fwh libs were a kind of a framework which always would be linked, because this these libs at least for some years now make the exe bigger. (At least from fwh1202 I can confirm with a test I made today: 839kb vs. 1772kb.
The file size with actual fivewin/xharbour is simular to yours: 831kb vs. 3404kb, which I wrote some a little further down.

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bloated EXEs (reprise)
Posted: Sun Jul 23, 2017 06:25 PM

This is something I don't understand:

  • fivehx.lib specified to the linker --> EXE size: 3208192
  • fivehx.lib do not specified to the linker --> EXE size: 829440

In both cases I get no linker errors! So the sample is not using any of the FWH symbols. Then why the EXE size grows when fivehx.lib is specified but not used?

EMG

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bloated EXEs (reprise)
Posted: Sun Jul 23, 2017 08:33 PM

Because FWH libs replace Harbour errorsys

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bloated EXEs (reprise)
Posted: Mon Jul 24, 2017 07:36 AM
The following sample is still 3195904:

Code (fw): Select all Collapse
FUNCTION MAIN()

    RETURN NIL


FUNCTION ERRORSYS()

    RETURN NIL


EMG
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Bloated EXEs (reprise)
Posted: Mon Jul 24, 2017 12:10 PM

you should review fwh sources one to one searching not static function which reescribe harbour system, in order to understand that size increase.

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bloated EXEs (reprise)
Posted: Mon Jul 24, 2017 12:36 PM

Please note that I'm not using any Harbour functions in my sample so EXE size should not increase even if FWH redefines any of those.

EMG