Re: [Kicad-developers] [MacOS] compiling with link-time optimization

2015-05-24 Thread Ladislav Laska
Hi!

 - does not work on any Linux install

Well, it works for me, and decreses the file size by a few megs. (gcc 4.9.2)

I'd suggest integrating this as optional feature, like -DLTO=yes. There is a lot
of work being done on lto support, and will get better in the future. 

It is annoying if you want to compile project with LTO (because, say, you're
working on a compiler and want to test new stuff), and the project can't easily
be compile that way. I know, since I'm doing this (with firefox) and I do need
to have some more wrappers to do it.

Here are the results:

krakonos@muskox ~ $ ls -all -h /home/krakonos/local-kicad-lto/bin/_*
-rwxr-xr-x 1 krakonos krakonos 4.4M May 23 10:18 
/home/krakonos/local-kicad-lto/bin/_cvpcb.kiface
-rwxr-xr-x 1 krakonos krakonos 4.9M May 23 10:25 
/home/krakonos/local-kicad-lto/bin/_eeschema.kiface
-rwxr-xr-x 1 krakonos krakonos 2.1M May 23 10:26 
/home/krakonos/local-kicad-lto/bin/_gerbview.kiface
-rwxr-xr-x 1 krakonos krakonos 1.5M May 23 10:41 
/home/krakonos/local-kicad-lto/bin/_pcb_calculator.kiface
-rwxr-xr-x 1 krakonos krakonos  11M May 23 10:39 
/home/krakonos/local-kicad-lto/bin/_pcbnew.kiface
-rwxr-xr-x 1 krakonos krakonos 1.9M May 23 10:41 
/home/krakonos/local-kicad-lto/bin/_pl_editor.kiface
krakonos@muskox ~ $ ls -all -h /home/krakonos/local/bin/_*
-rwxr-xr-x 1 krakonos krakonos 6.5M May 24 13:23 
/home/krakonos/local/bin/_cvpcb.kiface
-rwxr-xr-x 1 krakonos krakonos 6.9M May 24 13:23 
/home/krakonos/local/bin/_eeschema.kiface
-rwxr-xr-x 1 krakonos krakonos 2.9M May 24 13:21 
/home/krakonos/local/bin/_gerbview.kiface
-rwxr-xr-x 1 krakonos krakonos 2.1M May 24 13:22 
/home/krakonos/local/bin/_pcb_calculator.kiface
-rwxr-xr-x 1 krakonos krakonos  15M May 24 13:26 
/home/krakonos/local/bin/_pcbnew.kiface
-rwxr-xr-x 1 krakonos krakonos 2.6M May 24 13:22 
/home/krakonos/local/bin/_pl_editor.kiface


-- 
S pozdravem Ladislav Láska  la...@kam.mff.cuni.cz
Katedra Aplikované Matematiky, MFF UK   tel.: +420 739 464 167

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [MacOS] compiling with link-time optimization

2015-05-24 Thread jp charras
Le 24/05/2015 00:04, Simon Richter a écrit :
 Hi,
 
 On 23.05.2015 20:18, jp charras wrote:
 
 Sorry to say that, but what is the interest of this work:
 
 Now that is a good question. My initial goal was to basically shave
 a few percents off in text size and get a bit of extra speed, just
 by setting a few compiler flags.

I understand.


 
 I'm happy to put this on the back burner, because it isn't worth 
 investing a lot of effort into it, but it'd be one item off my
 list.

Make sense: it is more tricky as expected!

 
 - You said in a previous mail the link time is longer with LTO
 than without LT0, and this is a serious issue for developers (the
 compil time is often short when editing a few sources, so a
 longer link time is an issue)
 
 It's only enabled for Release builds -- it relies on the optimizer 
 actually doing something anyway, so Debug builds should be
 unaffected.
 
 Simon


-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [MacOS] compiling with link-time optimization

2015-05-23 Thread Simon Richter
Hi,

On 23.05.2015 20:18, jp charras wrote:

 Sorry to say that, but what is the interest of this work:

Now that is a good question. My initial goal was to basically shave a
few percents off in text size and get a bit of extra speed, just by
setting a few compiler flags.

I'm happy to put this on the back burner, because it isn't worth
investing a lot of effort into it, but it'd be one item off my list.

 - You said in a previous mail the link time is longer with LTO than
 without LT0, and this is a serious issue for developers (the compil time
 is often short when editing a few sources, so a longer link time is an
 issue)

It's only enabled for Release builds -- it relies on the optimizer
actually doing something anyway, so Debug builds should be unaffected.

   Simon




signature.asc
Description: OpenPGP digital signature
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [MacOS] compiling with link-time optimization

2015-05-23 Thread Bernhard Stegmaier
Hi again,

last comment/test:
Just dropping in “-flto” in CMakeLists.txt here:
set( CMAKE_CXX_FLAGS_DEBUG -g3 -ggdb3 -DDEBUG 
-Wno-deprecated-declarations )

set( CMAKE_C_FLAGS_RELEASE   ${CMAKE_C_FLAGS_RELEASE} -DNDEBUG -flto )
set( CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -flto )

if( GXX_HAS_VISIBILITY_FLAG AND NOT APPLE )

I had to remove -fno-fat-lto-objects” since clang didn’t like it and 
immediately bailed out.
At least this proved that above change did make a difference.

This time I compiled the exact same version and it also doesn’t seem to have 
any real effect:
bstegmaier$ ls -al KiCad-5678/kicad.app/Contents/PlugIns/
total 57288
drwxr-xr-x  8 bstegmaier  staff   272 23 Mai 18:49 .
drwxr-xr-x  9 bstegmaier  staff   306 23 Mai 18:49 ..
-rwxr-xr-x  1 bstegmaier  staff   5222076 23 Mai 18:49 _cvpcb.kiface
-rwxr-xr-x  1 bstegmaier  staff   5642208 23 Mai 18:49 _eeschema.kiface
-rwxr-xr-x  1 bstegmaier  staff   2109340 23 Mai 18:49 _gerbview.kiface
-rwxr-xr-x  1 bstegmaier  staff   1801528 23 Mai 18:49 _pcb_calculator.kiface
-rwxr-xr-x  1 bstegmaier  staff  12606536 23 Mai 18:49 _pcbnew.kiface
-rwxr-xr-x  1 bstegmaier  staff   1944760 23 Mai 18:49 _pl_editor.kiface
bstegmaier$ ls -al bin/kicad.app/Contents/PlugIns/
total 58560
drwxr-xr-x  8 bstegmaier  staff   272 23 Mai 19:10 .
drwxr-xr-x  9 bstegmaier  staff   306 23 Mai 19:10 ..
-rwxr-xr-x  1 bstegmaier  staff   5317400 23 Mai 19:10 _cvpcb.kiface
-rwxr-xr-x  1 bstegmaier  staff   5776284 23 Mai 19:10 _eeschema.kiface
-rwxr-xr-x  1 bstegmaier  staff   2143724 23 Mai 19:10 _gerbview.kiface
-rwxr-xr-x  1 bstegmaier  staff   1801776 23 Mai 19:10 _pcb_calculator.kiface
-rwxr-xr-x  1 bstegmaier  staff  12948516 23 Mai 19:10 _pcbnew.kiface
-rwxr-xr-x  1 bstegmaier  staff   1979112 23 Mai 19:10 _pl_editor.kiface

First one without “-flto”, second one with (yes, really… binaries are bigger 
with it?).


Regards,
Bernhard

 On 23.05.2015, at 18:48, Bernhard Stegmaier stegma...@sw-systems.de wrote:
 
 Hi again,
 
 I guess this is due to LTO not even being used on OS X, if I understand your 
 cmake change correctly:
 find_program(CMAKE_GCC_AR NAMES 
 ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_TOOLCHAIN_SUFFIX} HINTS 
 ${_CMAKE_TOOLCHAIN_LOCATION})
 find_program(CMAKE_GCC_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm 
 HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
 find_program(CMAKE_GCC_RANLIB NAMES 
 ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
 
 if( CMAKE_GCC_AR AND CMAKE_GCC_NM AND CMAKE_GCC_RANLIB )
 On my OS X using clang there is nothing like *gcc-ar*… or any of the other 
 two.
 Why do you have to change/set CMAKE_AR and the other two anyway?
 
 
 Regards,
 Bernhard
 
 On 23.05.2015, at 18:23, Bernhard Stegmaier stegma...@sw-systems.de 
 mailto:stegma...@sw-systems.de wrote:
 
 Hi,
 
 built your branch on OS X.
 
 Good thing is that build did work for me.
 I just quickly fired up pcbnew and loaded an existing board… seems to work.
 
 But, it doesn’t seem to have a real effect on code size (first one is my 
 current working version, second one your branch):
 bstegmaier$ ls -al /Applications/KiCad-5648/kicad.app/Contents/PlugIns/
 total 58904
 drwxr-xr-x  8 bstegmaier  admin   272  9 Mai 14:59 .
 drwxr-xr-x  9 bstegmaier  admin   306  9 Mai 14:59 ..
 -rwxr-xr-x  1 bstegmaier  admin   5683560  9 Mai 14:59 _cvpcb.kiface
 -rwxr-xr-x  1 bstegmaier  admin   5652288  9 Mai 14:59 _eeschema.kiface
 -rwxr-xr-x  1 bstegmaier  admin   2105068  9 Mai 14:59 _gerbview.kiface
 -rwxr-xr-x  1 bstegmaier  admin   1797432  9 Mai 14:59 _pcb_calculator.kiface
 -rwxr-xr-x  1 bstegmaier  admin  12970696  9 Mai 14:59 _pcbnew.kiface
 -rwxr-xr-x  1 bstegmaier  admin   1944576  9 Mai 14:59 _pl_editor.kiface
 bstegmaier$ ls -al bin/kicad.app/Contents/PlugIns/
 total 57128
 drwxr-xr-x  8 bstegmaier  staff   272 23 Mai 18:13 .
 drwxr-xr-x  9 bstegmaier  staff   306 23 Mai 18:13 ..
 -rwxr-xr-x  1 bstegmaier  staff   5215564 23 Mai 18:13 _cvpcb.kiface
 -rwxr-xr-x  1 bstegmaier  staff   5646432 23 Mai 18:13 _eeschema.kiface
 -rwxr-xr-x  1 bstegmaier  staff   2103556 23 Mai 18:13 _gerbview.kiface
 -rwxr-xr-x  1 bstegmaier  staff   1758640 23 Mai 18:13 _pcb_calculator.kiface
 -rwxr-xr-x  1 bstegmaier  staff  12570984 23 Mai 18:13 _pcbnew.kiface
 -rwxr-xr-x  1 bstegmaier  staff   1938952 23 Mai 18:13 _pl_editor.kiface
 
 The comparison isn’t accurate in any way… both binaries do use different 
 KiCad revisions and the build of your branch is done without github plugin, 
 my working version is with github plugin.
 
 Nevertheless… I think you would have expected a quite significant difference?
 
 
 Regards,
 Bernhard
 
 
 On 22.05.2015, at 16:51, Simon Richter simon.rich...@hogyros.de 
 mailto:simon.rich...@hogyros.de wrote:
 
 Hi,
 
 I've submitted a branch for inclusion at
 
 https://code.launchpad.net/~sjr/kicad/lto 
 https://code.launchpad.net/~sjr/kicad/lto
 
 that seeks to 

Re: [Kicad-developers] [MacOS] compiling with link-time optimization

2015-05-23 Thread Bernhard Stegmaier
Hi,

built your branch on OS X.

Good thing is that build did work for me.
I just quickly fired up pcbnew and loaded an existing board… seems to work.

But, it doesn’t seem to have a real effect on code size (first one is my 
current working version, second one your branch):
bstegmaier$ ls -al /Applications/KiCad-5648/kicad.app/Contents/PlugIns/
total 58904
drwxr-xr-x  8 bstegmaier  admin   272  9 Mai 14:59 .
drwxr-xr-x  9 bstegmaier  admin   306  9 Mai 14:59 ..
-rwxr-xr-x  1 bstegmaier  admin   5683560  9 Mai 14:59 _cvpcb.kiface
-rwxr-xr-x  1 bstegmaier  admin   5652288  9 Mai 14:59 _eeschema.kiface
-rwxr-xr-x  1 bstegmaier  admin   2105068  9 Mai 14:59 _gerbview.kiface
-rwxr-xr-x  1 bstegmaier  admin   1797432  9 Mai 14:59 _pcb_calculator.kiface
-rwxr-xr-x  1 bstegmaier  admin  12970696  9 Mai 14:59 _pcbnew.kiface
-rwxr-xr-x  1 bstegmaier  admin   1944576  9 Mai 14:59 _pl_editor.kiface
bstegmaier$ ls -al bin/kicad.app/Contents/PlugIns/
total 57128
drwxr-xr-x  8 bstegmaier  staff   272 23 Mai 18:13 .
drwxr-xr-x  9 bstegmaier  staff   306 23 Mai 18:13 ..
-rwxr-xr-x  1 bstegmaier  staff   5215564 23 Mai 18:13 _cvpcb.kiface
-rwxr-xr-x  1 bstegmaier  staff   5646432 23 Mai 18:13 _eeschema.kiface
-rwxr-xr-x  1 bstegmaier  staff   2103556 23 Mai 18:13 _gerbview.kiface
-rwxr-xr-x  1 bstegmaier  staff   1758640 23 Mai 18:13 _pcb_calculator.kiface
-rwxr-xr-x  1 bstegmaier  staff  12570984 23 Mai 18:13 _pcbnew.kiface
-rwxr-xr-x  1 bstegmaier  staff   1938952 23 Mai 18:13 _pl_editor.kiface

The comparison isn’t accurate in any way… both binaries do use different KiCad 
revisions and the build of your branch is done without github plugin, my 
working version is with github plugin.

Nevertheless… I think you would have expected a quite significant difference?


Regards,
Bernhard


 On 22.05.2015, at 16:51, Simon Richter simon.rich...@hogyros.de wrote:
 
 Hi,
 
 I've submitted a branch for inclusion at
 
 https://code.launchpad.net/~sjr/kicad/lto
 
 that seeks to use link-time optimization when possible.
 
 We've already established that this is broken on MSYS, so I'm going to
 disable it there, while it does some good on Linux. This leaves MacOS.
 
 Could anyone try building a Release configuration both with and without
 this branch, and check that a) the build still works, and b) we get a
 significant reduction in size?
 
 Thanks,
   Simon
 
 ___
 Mailing list: https://launchpad.net/~kicad-developers
 Post to : kicad-developers@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~kicad-developers
 More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [MacOS] compiling with link-time optimization

2015-05-23 Thread Bernhard Stegmaier
Hi again,

I guess this is due to LTO not even being used on OS X, if I understand your 
cmake change correctly:
find_program(CMAKE_GCC_AR NAMES 
${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_TOOLCHAIN_SUFFIX} HINTS 
${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_GCC_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm HINTS 
${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_GCC_RANLIB NAMES 
${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})

if( CMAKE_GCC_AR AND CMAKE_GCC_NM AND CMAKE_GCC_RANLIB )
On my OS X using clang there is nothing like *gcc-ar*… or any of the other two.
Why do you have to change/set CMAKE_AR and the other two anyway?


Regards,
Bernhard

 On 23.05.2015, at 18:23, Bernhard Stegmaier stegma...@sw-systems.de wrote:
 
 Hi,
 
 built your branch on OS X.
 
 Good thing is that build did work for me.
 I just quickly fired up pcbnew and loaded an existing board… seems to work.
 
 But, it doesn’t seem to have a real effect on code size (first one is my 
 current working version, second one your branch):
 bstegmaier$ ls -al /Applications/KiCad-5648/kicad.app/Contents/PlugIns/
 total 58904
 drwxr-xr-x  8 bstegmaier  admin   272  9 Mai 14:59 .
 drwxr-xr-x  9 bstegmaier  admin   306  9 Mai 14:59 ..
 -rwxr-xr-x  1 bstegmaier  admin   5683560  9 Mai 14:59 _cvpcb.kiface
 -rwxr-xr-x  1 bstegmaier  admin   5652288  9 Mai 14:59 _eeschema.kiface
 -rwxr-xr-x  1 bstegmaier  admin   2105068  9 Mai 14:59 _gerbview.kiface
 -rwxr-xr-x  1 bstegmaier  admin   1797432  9 Mai 14:59 _pcb_calculator.kiface
 -rwxr-xr-x  1 bstegmaier  admin  12970696  9 Mai 14:59 _pcbnew.kiface
 -rwxr-xr-x  1 bstegmaier  admin   1944576  9 Mai 14:59 _pl_editor.kiface
 bstegmaier$ ls -al bin/kicad.app/Contents/PlugIns/
 total 57128
 drwxr-xr-x  8 bstegmaier  staff   272 23 Mai 18:13 .
 drwxr-xr-x  9 bstegmaier  staff   306 23 Mai 18:13 ..
 -rwxr-xr-x  1 bstegmaier  staff   5215564 23 Mai 18:13 _cvpcb.kiface
 -rwxr-xr-x  1 bstegmaier  staff   5646432 23 Mai 18:13 _eeschema.kiface
 -rwxr-xr-x  1 bstegmaier  staff   2103556 23 Mai 18:13 _gerbview.kiface
 -rwxr-xr-x  1 bstegmaier  staff   1758640 23 Mai 18:13 _pcb_calculator.kiface
 -rwxr-xr-x  1 bstegmaier  staff  12570984 23 Mai 18:13 _pcbnew.kiface
 -rwxr-xr-x  1 bstegmaier  staff   1938952 23 Mai 18:13 _pl_editor.kiface
 
 The comparison isn’t accurate in any way… both binaries do use different 
 KiCad revisions and the build of your branch is done without github plugin, 
 my working version is with github plugin.
 
 Nevertheless… I think you would have expected a quite significant difference?
 
 
 Regards,
 Bernhard
 
 
 On 22.05.2015, at 16:51, Simon Richter simon.rich...@hogyros.de 
 mailto:simon.rich...@hogyros.de wrote:
 
 Hi,
 
 I've submitted a branch for inclusion at
 
 https://code.launchpad.net/~sjr/kicad/lto 
 https://code.launchpad.net/~sjr/kicad/lto
 
 that seeks to use link-time optimization when possible.
 
 We've already established that this is broken on MSYS, so I'm going to
 disable it there, while it does some good on Linux. This leaves MacOS.
 
 Could anyone try building a Release configuration both with and without
 this branch, and check that a) the build still works, and b) we get a
 significant reduction in size?
 
 Thanks,
   Simon
 
 ___
 Mailing list: https://launchpad.net/~kicad-developers
 Post to : kicad-developers@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~kicad-developers
 More help   : https://help.launchpad.net/ListHelp
 
 ___
 Mailing list: https://launchpad.net/~kicad-developers
 Post to : kicad-developers@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~kicad-developers
 More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [MacOS] compiling with link-time optimization

2015-05-23 Thread Simon Richter
Hi,

On 23.05.2015 18:48, Bernhard Stegmaier wrote:

 I guess this is due to LTO not even being used on OS X, if I understand your 
 cmake change correctly:
 find_program(CMAKE_GCC_AR NAMES 
 ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_TOOLCHAIN_SUFFIX} HINTS 
 ${_CMAKE_TOOLCHAIN_LOCATION})
 find_program(CMAKE_GCC_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm 
 HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
 find_program(CMAKE_GCC_RANLIB NAMES 
 ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})

 if( CMAKE_GCC_AR AND CMAKE_GCC_NM AND CMAKE_GCC_RANLIB )
 On my OS X using clang there is nothing like *gcc-ar*… or any of the other 
 two.
 Why do you have to change/set CMAKE_AR and the other two anyway?

Indeed, it seems this fails on OS X, so it falls back to non-LTO.

This is needed because regular binutils ar/nm/ranlib fail to work with
the LTO objects generated by gcc, so gcc ships extra wrappers.

Presumably, the correct approach would be

 - if MSYS, disable LTO (because it's broken)
 - if gcc, look for gcc-ar/gcc-nm/gcc-ranlib
 - if llvm, look for llvm-ar/llvm-nm/llvm-ranlib
 - if no toolchain specific tools were found, try whether the regular
ones work.

I still have to look into the problems jp had on Ubuntu -- that
shouldn't happen.

For me, it's quite a bit of a size difference on gcc (25%).

without LTO:
-rwxr-xr-x 1 geier geier 14995616 Mai 23 18:56

textsize is 12950112

with LTO:
-rwxr-xr-x 1 geier geier 11152184 Mai 23 05:53 _pcbnew.kiface

textsize is 9422117

with LLVM, the effect is a bit more pronounced IIRC, but I'd need to
rebuild for actual numbers.

   Simon



signature.asc
Description: OpenPGP digital signature
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [MacOS] compiling with link-time optimization

2015-05-23 Thread jp charras
Le 22/05/2015 16:51, Simon Richter a écrit :
 Hi,
 
 I've submitted a branch for inclusion at
 
 https://code.launchpad.net/~sjr/kicad/lto
 
 that seeks to use link-time optimization when possible.
 
 We've already established that this is broken on MSYS, so I'm going
 to disable it there, while it does some good on Linux. This leaves
 MacOS.
 
 Could anyone try building a Release configuration both with and
 without this branch, and check that a) the build still works, and
 b) we get a significant reduction in size?
 
 Thanks, Simon

I am not a MacOS user, but to see what happens, I tested in on Linux
Kubuntu 14.04 LTS: with this patch, the build process does not work.


-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [MacOS] compiling with link-time optimization

2015-05-23 Thread jp charras
Le 23/05/2015 19:17, Simon Richter a écrit :
 Hi,
 
 On 23.05.2015 18:48, Bernhard Stegmaier wrote:
 
 I guess this is due to LTO not even being used on OS X, if I
 understand your cmake change correctly: find_program(CMAKE_GCC_AR
 NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_TOOLCHAIN_SUFFIX}
 HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_GCC_NM
 NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm HINTS
 ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_GCC_RANLIB NAMES
 ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib HINTS
 ${_CMAKE_TOOLCHAIN_LOCATION})
 
 if( CMAKE_GCC_AR AND CMAKE_GCC_NM AND CMAKE_GCC_RANLIB ) On my OS
 X using clang there is nothing like *gcc-ar*… or any of the other
 two. Why do you have to change/set CMAKE_AR and the other two
 anyway?
 
 Indeed, it seems this fails on OS X, so it falls back to non-LTO.
 
 This is needed because regular binutils ar/nm/ranlib fail to work
 with the LTO objects generated by gcc, so gcc ships extra
 wrappers.
 
 Presumably, the correct approach would be
 
 - if MSYS, disable LTO (because it's broken) - if gcc, look for
 gcc-ar/gcc-nm/gcc-ranlib - if llvm, look for
 llvm-ar/llvm-nm/llvm-ranlib - if no toolchain specific tools were
 found, try whether the regular ones work.
 
 I still have to look into the problems jp had on Ubuntu -- that 
 shouldn't happen.
 
 For me, it's quite a bit of a size difference on gcc (25%).
 
 without LTO: -rwxr-xr-x 1 geier geier 14995616 Mai 23 18:56
 
 textsize is 12950112
 
 with LTO: -rwxr-xr-x 1 geier geier 11152184 Mai 23 05:53
 _pcbnew.kiface
 
 textsize is 9422117
 
 with LLVM, the effect is a bit more pronounced IIRC, but I'd need
 to rebuild for actual numbers.
 
 Simon

Simon,

Sorry to say that, but what is the interest of this work:

- LTO is not usable on mingw
- looks not very useful on OSX
- does not work on any Linux install
- binaries are slightly smaller, but the full diff is something like
20 Mbytes or less (according to the info in your mail), and a full
Kicad install (with docs, libs, 3D shapes...) is at least 300 Mbytes
(800 Mbytes on Windows, with python, wxWidgets and some other libs).
 And smaller binaries does not mean faster execution time (this is
often the opposite)
- You said in a previous mail the link time is longer with LTO than
without LT0, and this is a serious issue for developers (the compil time
is often short when editing a few sources, so a longer link time is an
issue)

Thanks.

-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [MacOS] compiling with link-time optimization

2015-05-22 Thread Mário Luzeiro
Will that speed up the building process also?

Mario Luzeiro

From: Kicad-developers 
[kicad-developers-bounces+mrluzeiro=ua...@lists.launchpad.net] on behalf of 
Simon Richter [simon.rich...@hogyros.de]
Sent: 22 May 2015 16:51
To: KiCad Developers
Subject: [Kicad-developers] [MacOS] compiling with link-time optimization

Hi,

I've submitted a branch for inclusion at

https://code.launchpad.net/~sjr/kicad/lto

that seeks to use link-time optimization when possible.

We've already established that this is broken on MSYS, so I'm going to
disable it there, while it does some good on Linux. This leaves MacOS.

Could anyone try building a Release configuration both with and without
this branch, and check that a) the build still works, and b) we get a
significant reduction in size?

Thanks,
   Simon


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [MacOS] compiling with link-time optimization

2015-05-22 Thread Simon Richter
Hi,

 Will that speed up the building process also?

It might, a tiny bit, but in my experience it was mostly neutral, as the
savings from the shorter compiler invocations were eaten up because now
the linker took a lot more time.

   Simon



signature.asc
Description: OpenPGP digital signature
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp