Skip to content

make: build with linker garbage collection#3163

Merged
jnohlgard merged 1 commit intoRIOT-OS:masterfrom
jnohlgard:pr/adopted/add_gc
Jul 13, 2015
Merged

make: build with linker garbage collection#3163
jnohlgard merged 1 commit intoRIOT-OS:masterfrom
jnohlgard:pr/adopted/add_gc

Conversation

@jnohlgard
Copy link
Copy Markdown
Member

Adopted #1784 and rebased on latest master.

Currently only has the linker flag --gc-sections defined which tells
the linker to omit dead code. Depending on the application this leads
to significant reduction of code size.

@jnohlgard jnohlgard added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Platform: ARM Platform: This PR/issue effects ARM-based platforms labels Jun 4, 2015
@haukepetersen
Copy link
Copy Markdown
Contributor

Finally those cortexm clean-up PRs pay off :-)

@miri64 miri64 closed this Jun 4, 2015
@miri64
Copy link
Copy Markdown
Member

miri64 commented Jun 4, 2015

Errr what.. I can't remember doing that. Sorry.

@miri64 miri64 reopened this Jun 4, 2015
@cgundogan
Copy link
Copy Markdown
Member

isn't it also necessary to add -ffunction-sections -fdata-sections to gcc in order to utilize the linker's no-dead-code optimization?

@cgundogan
Copy link
Copy Markdown
Member

Ah never mind, seems like those options are enabled in Makefile.include.cortexm_common

@thomaseichinger thomaseichinger added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 17, 2015
@thomaseichinger
Copy link
Copy Markdown
Member

@gebart Thanks for adopting this. Added the CI label and kicked Travis.

@OlegHahm OlegHahm assigned thomaseichinger and unassigned OlegHahm Jun 23, 2015
@OlegHahm
Copy link
Copy Markdown
Member

Apparently the builds are really failing and are not just a Travis hickup.

@haukepetersen
Copy link
Copy Markdown
Contributor

ACK from my side and Travis is happy, should we merge this?

@OlegHahm
Copy link
Copy Markdown
Member

OlegHahm commented Jul 2, 2015

Has someone tested?

@jnohlgard
Copy link
Copy Markdown
Member Author

This should be fairly low-risk when building without LTO. With LTO enabled stuff might start disappearing if we forget to add __attribute__((used)) on the interrupt vector, for example.

@jnohlgard
Copy link
Copy Markdown
Member Author

Results from the examples directory:
(for f in *; do make -C $f clean buildtest BUILD_IN_DOCKER=1 BINDIRBASE=with-gc-sections; done)

make: Entering directory '/home/kim/work/src/riot/examples/ccn-lite-client'
text    data    bss     dec     BOARD/BINDIRBASE

-19268  -32     32      -19268  avsextrem
109368  5632    92669   207669  without-gc-sections
90100   5600    92701   188401  with-gc-sections

ERR     ERR     ERR     ERR     chronos
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-4456   0       -56     -4512   fox
44336   3412    21072   68820   without-gc-sections
39880   3412    21016   64308   with-gc-sections

-4460   0       -56     -4516   iot-lab_M3
44512   3412    21080   69004   without-gc-sections
40052   3412    21024   64488   with-gc-sections

ERR     ERR     ERR     ERR     msb-430h
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-19308  -32     32      -19308  msba2
109024  5632    92669   207325  without-gc-sections
89716   5600    92701   188017  with-gc-sections

-5248   0       -56     -5304   msbiot
40936   3456    21480   65872   without-gc-sections
35688   3456    21424   60568   with-gc-sections

-7124   -72     -72     -7268   mulle
46476   4536    22848   73860   without-gc-sections
39352   4464    22776   66592   with-gc-sections

0       0       0       0       native
105428  3956    170688  280072  without-gc-sections
105428  3956    170688  280072  with-gc-sections

ERR     ERR     ERR     ERR     redbee-econotag
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-4260   0       -56     -4316   samr21-xpro
42508   3412    21064   66984   without-gc-sections
38248   3412    21008   62668   with-gc-sections

ERR     ERR     ERR     ERR     telosb
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_3b
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_4
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     z1
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

make: Leaving directory '/home/kim/work/src/riot/examples/ccn-lite-client'
make: Entering directory '/home/kim/work/src/riot/examples/ccn-lite-relay'
text    data    bss     dec     BOARD/BINDIRBASE

-23852  -88     92      -23848  avsextrem
97120   5576    92721   195417  without-gc-sections
73268   5488    92813   171569  with-gc-sections

ERR     ERR     ERR     ERR     chronos
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-11764  -16     -2368   -14148  fox
36680   3360    11712   51752   without-gc-sections
24916   3344    9344    37604   with-gc-sections

-11848  -16     -2368   -14232  iot-lab_M3
36856   3360    11720   51936   without-gc-sections
25008   3344    9352    37704   with-gc-sections

ERR     ERR     ERR     ERR     msb-430h
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-23860  -88     92      -23856  msba2
96784   5576    92721   195081  without-gc-sections
72924   5488    92813   171225  with-gc-sections

-8928   -56     -2824   -11808  msbiot
33472   3404    12180   49056   without-gc-sections
24544   3348    9356    37248   with-gc-sections

-14088  -88     -2396   -16572  mulle
38824   4484    13488   56796   without-gc-sections
24736   4396    11092   40224   with-gc-sections

0       0       0       0       native
81670   3888    137408  222966  without-gc-sections
81670   3888    137408  222966  with-gc-sections

ERR     ERR     ERR     ERR     redbee-econotag
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-11092  -16     -2376   -13484  samr21-xpro
34876   3360    11704   49940   without-gc-sections
23784   3344    9328    36456   with-gc-sections

ERR     ERR     ERR     ERR     telosb
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_3b
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_4
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     z1
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

make: Leaving directory '/home/kim/work/src/riot/examples/ccn-lite-relay'
make: Entering directory '/home/kim/work/src/riot/examples/default'
text    data    bss     dec     BOARD/BINDIRBASE

-3836   0       -8      -3844   airfy-beacon
15736   148     3836    19720   without-gc-sections
11900   148     3828    15876   with-gc-sections

-3944   0       -8      -3952   arduino-due
16076   152     3912    20140   without-gc-sections
12132   152     3904    16188   with-gc-sections

ERR     ERR     ERR     ERR     arduino-mega2560
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-13060  -40     40      -13060  avsextrem
74200   2428    95873   172501  without-gc-sections
61140   2388    95913   159441  with-gc-sections

-3448   0       0       -3448   cc2538dk
15100   148     3828    19076   without-gc-sections
11652   148     3828    15628   with-gc-sections

ERR     ERR     ERR     ERR     chronos
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-3392   0       -8      -3400   f4vi1
16560   152     3848    20560   without-gc-sections
13168   152     3840    17160   with-gc-sections

-4316   0       -8      -4324   fox
32472   168     8376    41016   without-gc-sections
28156   168     8368    36692   with-gc-sections

-3328   -8      -8      -3344   frdm-k64f
19376   1252    5996    26624   without-gc-sections
16048   1244    5988    23280   with-gc-sections

-4464   0       -8      -4472   iot-lab_M3
33440   168     8392    42000   without-gc-sections
28976   168     8384    37528   with-gc-sections

-5068   -4      -4      -5076   mbed_lpc1768
16500   152     3856    20508   without-gc-sections
11432   148     3852    15432   with-gc-sections

ERR     ERR     ERR     ERR     msb-430
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     msb-430h
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-14724  -40     40      -14724  msba2
87072   2436    93877   183385  without-gc-sections
72348   2396    93917   168661  with-gc-sections

-4604   0       -8      -4612   msbiot
24372   212     8820    33404   without-gc-sections
19768   212     8812    28792   with-gc-sections

-4136   -8      -16     -4160   mulle
31300   1292    10112   42704   without-gc-sections
27164   1284    10096   38544   with-gc-sections

0       0       0       0       native
73212   590     129216  203018  without-gc-sections
73212   590     129216  203018  with-gc-sections

-3784   0       0       -3784   nucleo-f091
18812   148     3852    22812   without-gc-sections
15028   148     3852    19028   with-gc-sections

-3320   0       -8      -3328   nucleo-f303
16444   148     3868    20460   without-gc-sections
13124   148     3860    17132   with-gc-sections

-3264   0       -8      -3272   nucleo-f334
16132   148     3844    20124   without-gc-sections
12868   148     3836    16852   with-gc-sections

-3368   0       0       -3368   nucleo-l1
16448   148     3844    20440   without-gc-sections
13080   148     3844    17072   with-gc-sections

-3448   0       0       -3448   openmote
15052   148     3828    19028   without-gc-sections
11604   148     3828    15580   with-gc-sections

-3328   -8      -8      -3344   pba-d-01-kw2x
19444   1252    5380    26076   without-gc-sections
16116   1244    5372    22732   with-gc-sections

-3836   0       -8      -3844   pca10000
15764   148     3836    19748   without-gc-sections
11928   148     3828    15904   with-gc-sections

-3836   0       -8      -3844   pca10005
15740   148     3836    19724   without-gc-sections
11904   148     3828    15880   with-gc-sections

-12180  -40     40      -12180  pttu
64936   2372    95929   163237  without-gc-sections
52756   2332    95969   151057  with-gc-sections

ERR     ERR     ERR     ERR     qemu-i386
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-13236  -32     -12     -13280  redbee-econotag
71508   2376    20068   93952   without-gc-sections
58272   2344    20056   80672   with-gc-sections

-4220   0       0       -4220   saml21-xpro
16084   148     3932    20164   without-gc-sections
11864   148     3932    15944   with-gc-sections

-3572   0       -8      -3580   samr21-xpro
28008   172     8336    36516   without-gc-sections
24436   172     8328    32936   with-gc-sections

-3392   0       0       -3392   spark-core
16920   148     3844    20912   without-gc-sections
13528   148     3844    17520   with-gc-sections

-3784   0       0       -3784   stm32f0discovery
18816   148     3852    22816   without-gc-sections
15032   148     3852    19032   with-gc-sections

-3320   0       -8      -3328   stm32f3discovery
16448   148     3868    20464   without-gc-sections
13128   148     3860    17136   with-gc-sections

-3456   0       0       -3456   stm32f4discovery
16788   152     3856    20796   without-gc-sections
13332   152     3856    17340   with-gc-sections

ERR     ERR     ERR     ERR     telosb
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-3944   0       -8      -3952   udoo
16076   152     3912    20140   without-gc-sections
12132   152     3904    16188   with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_3b
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_4
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-3836   0       -8      -3844   yunjia-nrf51822
15724   148     3836    19708   without-gc-sections
11888   148     3828    15864   with-gc-sections

ERR     ERR     ERR     ERR     z1
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

make: Leaving directory '/home/kim/work/src/riot/examples/default'
make: Entering directory '/home/kim/work/src/riot/examples/hello-world'
text    data    bss     dec     BOARD/BINDIRBASE

-3492   0       -8      -3500   airfy-beacon
11644   112     2696    14452   without-gc-sections
8152    112     2688    10952   with-gc-sections

-3416   0       -8      -3424   arduino-due
11900   116     2772    14788   without-gc-sections
8484    116     2764    11364   with-gc-sections

ERR     ERR     ERR     ERR     arduino-mega2560
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-11592  -32     36      -11588  avsextrem
51328   2264    96033   149625  without-gc-sections
39736   2232    96069   138037  with-gc-sections

-2892   0       0       -2892   cc2538dk
10920   112     2688    13720   without-gc-sections
8028    112     2688    10828   with-gc-sections

ERR     ERR     ERR     ERR     chronos
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-2860   0       -8      -2868   f4vi1
12380   116     2708    15204   without-gc-sections
9520    116     2700    12336   with-gc-sections

-2952   0       0       -2952   fox
12680   112     2704    15496   without-gc-sections
9728    112     2704    12544   with-gc-sections

-2620   0       -8      -2628   frdm-k64f
10624   1140    4828    16592   without-gc-sections
8004    1140    4820    13964   with-gc-sections

-2948   0       0       -2948   iot-lab_M3
12712   112     2704    15528   without-gc-sections
9764    112     2704    12580   with-gc-sections

-4436   -4      -4      -4444   mbed_lpc1768
12316   116     2716    15148   without-gc-sections
7880    112     2712    10704   with-gc-sections

ERR     ERR     ERR     ERR     msb-430
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     msb-430h
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-11624  -32     36      -11620  msba2
51024   2264    96033   149321  without-gc-sections
39400   2232    96069   137701  with-gc-sections

-2980   0       -8      -2988   msbiot
12780   116     2732    15628   without-gc-sections
9800    116     2724    12640   with-gc-sections

-5608   -72     -16     -5696   mulle
15664   1236    4580    21480   without-gc-sections
10056   1164    4564    15784   with-gc-sections

0       0       0       0       native
30506   400     52060   82966   without-gc-sections
30506   400     52060   82966   with-gc-sections

-3316   0       0       -3316   nucleo-f091
14724   112     2712    17548   without-gc-sections
11408   112     2712    14232   with-gc-sections

-2772   0       -8      -2780   nucleo-f303
12268   112     2728    15108   without-gc-sections
9496    112     2720    12328   with-gc-sections

-2716   0       -8      -2724   nucleo-f334
11956   112     2704    14772   without-gc-sections
9240    112     2696    12048   with-gc-sections

-2920   0       0       -2920   nucleo-l1
12268   112     2704    15084   without-gc-sections
9348    112     2704    12164   with-gc-sections

-2892   0       0       -2892   openmote
10872   112     2688    13672   without-gc-sections
7980    112     2688    10780   with-gc-sections

-2620   0       -8      -2628   pba-d-01-kw2x
10696   1140    4212    16048   without-gc-sections
8076    1140    4204    13420   with-gc-sections

-3492   0       -8      -3500   pca10000
11668   112     2696    14476   without-gc-sections
8176    112     2688    10976   with-gc-sections

-3492   0       -8      -3500   pca10005
11644   112     2696    14452   without-gc-sections
8152    112     2688    10952   with-gc-sections

-11584  -32     36      -11580  pttu
51528   2264    96033   149825  without-gc-sections
39944   2232    96069   138245  with-gc-sections

ERR     ERR     ERR     ERR     qemu-i386
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-11932  -32     -12     -11976  redbee-econotag
52772   2296    8984    64052   without-gc-sections
40840   2264    8972    52076   with-gc-sections

-3756   0       0       -3756   saml21-xpro
11988   112     2792    14892   without-gc-sections
8232    112     2792    11136   with-gc-sections

-3424   0       0       -3424   samr21-xpro
11732   112     2680    14524   without-gc-sections
8308    112     2680    11100   with-gc-sections

-2948   0       0       -2948   spark-core
12740   112     2704    15556   without-gc-sections
9792    112     2704    12608   with-gc-sections

-3316   0       0       -3316   stm32f0discovery
14732   112     2712    17556   without-gc-sections
11416   112     2712    14240   with-gc-sections

-2772   0       -8      -2780   stm32f3discovery
12276   112     2728    15116   without-gc-sections
9504    112     2720    12336   with-gc-sections

-2920   0       0       -2920   stm32f4discovery
12616   116     2716    15448   without-gc-sections
9696    116     2716    12528   with-gc-sections

ERR     ERR     ERR     ERR     telosb
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-3416   0       -8      -3424   udoo
11892   116     2772    14780   without-gc-sections
8476    116     2764    11356   with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_3b
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_4
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-3488   0       -8      -3496   yunjia-nrf51822
11624   112     2696    14432   without-gc-sections
8136    112     2688    10936   with-gc-sections

ERR     ERR     ERR     ERR     z1
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

make: Leaving directory '/home/kim/work/src/riot/examples/hello-world'
make: Entering directory '/home/kim/work/src/riot/examples/ipc_pingpong'
text    data    bss     dec     BOARD/BINDIRBASE

-3828   0       -8      -3836   airfy-beacon
12756   112     4232    17100   without-gc-sections
8928    112     4224    13264   with-gc-sections

-3768   0       -8      -3776   arduino-due
13036   116     4308    17460   without-gc-sections
9268    116     4300    13684   with-gc-sections

ERR     ERR     ERR     ERR     arduino-mega2560
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-12056  -32     36      -12052  avsextrem
53112   2264    96033   151409  without-gc-sections
41056   2232    96069   139357  with-gc-sections

-3248   0       0       -3248   cc2538dk
12064   112     4224    16400   without-gc-sections
8816    112     4224    13152   with-gc-sections

ERR     ERR     ERR     ERR     chronos
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-3216   0       -8      -3224   f4vi1
13524   116     4244    17884   without-gc-sections
10308   116     4236    14660   with-gc-sections

-3304   0       0       -3304   fox
13824   112     4240    18176   without-gc-sections
10520   112     4240    14872   with-gc-sections

-2976   0       -8      -2984   frdm-k64f
11772   1140    6364    19276   without-gc-sections
8796    1140    6356    16292   with-gc-sections

-3304   0       0       -3304   iot-lab_M3
13852   112     4240    18204   without-gc-sections
10548   112     4240    14900   with-gc-sections

-4788   -4      -4      -4796   mbed_lpc1768
13460   116     4252    17828   without-gc-sections
8672    112     4248    13032   with-gc-sections

ERR     ERR     ERR     ERR     msb-430
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     msb-430h
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-12104  -32     36      -12100  msba2
52824   2264    96033   151121  without-gc-sections
40720   2232    96069   139021  with-gc-sections

-3336   0       -8      -3344   msbiot
13924   116     4268    18308   without-gc-sections
10588   116     4260    14964   with-gc-sections

-5964   -72     -16     -6052   mulle
16812   1236    6116    24164   without-gc-sections
10848   1164    6100    18112   with-gc-sections

0       0       0       0       native
34266   400     68480   103146  without-gc-sections
34266   400     68480   103146  with-gc-sections

-3652   0       0       -3652   nucleo-f091
15836   112     4248    20196   without-gc-sections
12184   112     4248    16544   with-gc-sections

-3132   0       -8      -3140   nucleo-f303
13408   112     4264    17784   without-gc-sections
10276   112     4256    14644   with-gc-sections

-3076   0       -8      -3084   nucleo-f334
13096   112     4240    17448   without-gc-sections
10020   112     4232    14364   with-gc-sections

-3276   0       0       -3276   nucleo-l1
13408   112     4240    17760   without-gc-sections
10132   112     4240    14484   with-gc-sections

-3248   0       0       -3248   openmote
12016   112     4224    16352   without-gc-sections
8768    112     4224    13104   with-gc-sections

-2976   0       -8      -2984   pba-d-01-kw2x
11840   1140    5748    18728   without-gc-sections
8864    1140    5740    15744   with-gc-sections

-3828   0       -8      -3836   pca10000
12784   112     4232    17128   without-gc-sections
8956    112     4224    13292   with-gc-sections

-3828   0       -8      -3836   pca10005
12760   112     4232    17104   without-gc-sections
8932    112     4224    13268   with-gc-sections

-12056  -32     36      -12052  pttu
53320   2264    96033   151617  without-gc-sections
41264   2232    96069   139565  with-gc-sections

ERR     ERR     ERR     ERR     qemu-i386
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-12620  -32     -12     -12664  redbee-econotag
55020   2296    11544   68860   without-gc-sections
42400   2264    11532   56196   with-gc-sections

-4096   0       0       -4096   saml21-xpro
13104   112     4328    17544   without-gc-sections
9008    112     4328    13448   with-gc-sections

-3764   0       0       -3764   samr21-xpro
12848   112     4216    17176   without-gc-sections
9084    112     4216    13412   with-gc-sections

-3304   0       0       -3304   spark-core
13880   112     4240    18232   without-gc-sections
10576   112     4240    14928   with-gc-sections

-3652   0       0       -3652   stm32f0discovery
15840   112     4248    20200   without-gc-sections
12188   112     4248    16548   with-gc-sections

-3132   0       -8      -3140   stm32f3discovery
13412   112     4264    17788   without-gc-sections
10280   112     4256    14648   with-gc-sections

-3280   0       0       -3280   stm32f4discovery
13752   116     4252    18120   without-gc-sections
10472   116     4252    14840   with-gc-sections

ERR     ERR     ERR     ERR     telosb
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-3768   0       -8      -3776   udoo
13036   116     4308    17460   without-gc-sections
9268    116     4300    13684   with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_3b
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_4
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-3828   0       -8      -3836   yunjia-nrf51822
12744   112     4232    17088   without-gc-sections
8916    112     4224    13252   with-gc-sections

ERR     ERR     ERR     ERR     z1
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

make: Leaving directory '/home/kim/work/src/riot/examples/ipc_pingpong'
make: Entering directory '/home/kim/work/src/riot/examples/ng_networking'
text    data    bss     dec     BOARD/BINDIRBASE

ERR     ERR     ERR     ERR     airfy-beacon
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-4424   0       -8      -4432   arduino-due
42780   172     17804   60756   without-gc-sections
38356   172     17796   56324   with-gc-sections

-17884  -32     36      -17880  avsextrem
118904  2316    95981   217201  without-gc-sections
101020  2284    96017   199321  with-gc-sections

-3932   0       0       -3932   cc2538dk
41808   168     17720   59696   without-gc-sections
37876   168     17720   55764   with-gc-sections

ERR     ERR     ERR     ERR     chronos
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-3880   0       -8      -3888   f4vi1
43252   172     17740   61164   without-gc-sections
39372   172     17732   57276   with-gc-sections

-3872   0       0       -3872   fox
43568   168     17736   61472   without-gc-sections
39696   168     17736   57600   with-gc-sections

-3748   0       -8      -3756   frdm-k64f
41532   1196    19860   62588   without-gc-sections
37784   1196    19852   58832   with-gc-sections

-3804   0       -8      -3812   iot-lab_M3
53676   168     20456   74300   without-gc-sections
49872   168     20448   70488   with-gc-sections

-4084   -4      -4      -4092   mbed_lpc1768
41740   172     17748   59660   without-gc-sections
37656   168     17744   55568   with-gc-sections

ERR     ERR     ERR     ERR     msb-430
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     msb-430h
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-17924  -32     36      -17920  msba2
118608  2316    95981   216905  without-gc-sections
100684  2284    96017   198985  with-gc-sections

-4000   0       -8      -4008   msbiot
43652   172     17764   61588   without-gc-sections
39652   172     17756   57580   with-gc-sections

-6728   -72     -16     -6816   mulle
46552   1292    19612   67456   without-gc-sections
39824   1220    19596   60640   with-gc-sections

0       0       0       0       native
134410  548     115712  250670  without-gc-sections
134410  548     115712  250670  with-gc-sections

-4120   0       0       -4120   nucleo-f091
49932   168     17744   67844   without-gc-sections
45812   168     17744   63724   with-gc-sections

-3808   0       -8      -3816   nucleo-f303
43136   168     17760   61064   without-gc-sections
39328   168     17752   57248   with-gc-sections

ERR     ERR     ERR     ERR     nucleo-f334
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-3848   0       0       -3848   nucleo-l1
43152   168     17736   61056   without-gc-sections
39304   168     17736   57208   with-gc-sections

-3932   0       0       -3932   openmote
41760   168     17720   59648   without-gc-sections
37828   168     17720   55716   with-gc-sections

-3956   0       -16     -3972   pba-d-01-kw2x
53508   1196    22068   76772   without-gc-sections
49552   1196    22052   72800   with-gc-sections

ERR     ERR     ERR     ERR     pca10000
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     pca10005
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-17884  -32     36      -17880  pttu
119112  2316    95981   217409  without-gc-sections
101228  2284    96017   199529  with-gc-sections

ERR     ERR     ERR     ERR     qemu-i386
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     redbee-econotag
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-4556   0       0       -4556   saml21-xpro
47280   168     17824   65272   without-gc-sections
42724   168     17824   60716   with-gc-sections

-3568   0       -8      -3576   samr21-xpro
57720   168     20440   78328   without-gc-sections
54152   168     20432   74752   with-gc-sections

-3872   0       0       -3872   spark-core
43624   168     17736   61528   without-gc-sections
39752   168     17736   57656   with-gc-sections

ERR     ERR     ERR     ERR     stm32f0discovery
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-3808   0       -8      -3816   stm32f3discovery
43140   168     17760   61068   without-gc-sections
39332   168     17752   57252   with-gc-sections

-3944   0       0       -3944   stm32f4discovery
43480   172     17748   61400   without-gc-sections
39536   172     17748   57456   with-gc-sections

ERR     ERR     ERR     ERR     telosb
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-4424   0       -8      -4432   udoo
42780   172     17804   60756   without-gc-sections
38356   172     17796   56324   with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_3b
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_4
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     yunjia-nrf51822
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     z1
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

make: Leaving directory '/home/kim/work/src/riot/examples/ng_networking'
make: Entering directory '/home/kim/work/src/riot/examples/riot_and_cpp'
text    data    bss     dec     BOARD/BINDIRBASE

-3876   0       0       -3876   airfy-beacon
22560   120     4248    26928   without-gc-sections
18684   120     4248    23052   with-gc-sections

-4208   0       0       -4208   arduino-due
23112   124     4324    27560   without-gc-sections
18904   124     4324    23352   with-gc-sections

-3688   0       -8      -3696   cc2538dk
22136   120     4248    26504   without-gc-sections
18448   120     4240    22808   with-gc-sections

-3648   0       0       -3648   f4vi1
23600   124     4260    27984   without-gc-sections
19952   124     4260    24336   with-gc-sections

-3744   0       -8      -3752   fox
23904   120     4264    28288   without-gc-sections
20160   120     4256    24536   with-gc-sections

-3408   0       0       -3408   frdm-k64f
21856   1148    6380    29384   without-gc-sections
18448   1148    6380    25976   with-gc-sections

-3744   0       -8      -3752   iot-lab_M3
23928   120     4264    28312   without-gc-sections
20184   120     4256    24560   with-gc-sections

-5224   -4      -4      -5232   mbed_lpc1768
23528   124     4268    27920   without-gc-sections
18304   120     4264    22688   with-gc-sections

-12488  -32     36      -12484  msba2
69244   2272    96021   167537  without-gc-sections
56756   2240    96057   155053  with-gc-sections

-3768   0       0       -3768   msbiot
24000   124     4284    28408   without-gc-sections
20232   124     4284    24640   with-gc-sections

-6400   -72     -16     -6488   mulle
26896   1244    6132    34272   without-gc-sections
20496   1172    6116    27784   with-gc-sections

0       0       0       0       native
42348   456     68480   111284  without-gc-sections
42348   456     68480   111284  with-gc-sections

-3684   0       -8      -3692   nucleo-f091
25584   120     4272    29976   without-gc-sections
21900   120     4264    26284   with-gc-sections

-3568   0       0       -3568   nucleo-f303
23488   120     4280    27888   without-gc-sections
19920   120     4280    24320   with-gc-sections

-3504   0       0       -3504   nucleo-f334
23168   120     4256    27544   without-gc-sections
19664   120     4256    24040   with-gc-sections

-3712   0       -8      -3720   nucleo-l1
23480   120     4264    27864   without-gc-sections
19768   120     4256    24144   with-gc-sections

-3688   0       -8      -3696   openmote
22088   120     4248    26456   without-gc-sections
18400   120     4240    22760   with-gc-sections

-3876   0       0       -3876   pca10000
22592   120     4248    26960   without-gc-sections
18716   120     4248    23084   with-gc-sections

-3876   0       0       -3876   pca10005
22568   120     4248    26936   without-gc-sections
18692   120     4248    23060   with-gc-sections

-4140   0       -8      -4148   saml21-xpro
22928   120     4352    27400   without-gc-sections
18788   120     4344    23252   with-gc-sections

-3804   0       -8      -3812   samr21-xpro
22672   120     4240    27032   without-gc-sections
18868   120     4232    23220   with-gc-sections

-3744   0       -8      -3752   spark-core
23960   120     4264    28344   without-gc-sections
20216   120     4256    24592   with-gc-sections

ERR     ERR     ERR     ERR     stm32f0discovery
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-3568   0       0       -3568   stm32f3discovery
23488   120     4280    27888   without-gc-sections
19920   120     4280    24320   with-gc-sections

-3712   0       -8      -3720   stm32f4discovery
23824   124     4276    28224   without-gc-sections
20112   124     4268    24504   with-gc-sections

-4208   0       0       -4208   udoo
23112   124     4324    27560   without-gc-sections
18904   124     4324    23352   with-gc-sections

-3876   0       0       -3876   yunjia-nrf51822
22552   120     4248    26920   without-gc-sections
18676   120     4248    23044   with-gc-sections

make: Leaving directory '/home/kim/work/src/riot/examples/riot_and_cpp'
make: Entering directory '/home/kim/work/src/riot/examples/rpl_udp'
text    data    bss     dec     BOARD/BINDIRBASE

-22540  -32     36      -22536  avsextrem
148776  2432    95861   247069  without-gc-sections
126236  2400    95897   224533  with-gc-sections

ERR     ERR     ERR     ERR     chronos
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-6404   0       -5752   -12156  fox
66636   240     36720   103596  without-gc-sections
60232   240     30968   91440   with-gc-sections

-6400   0       -5752   -12152  iot-lab_M3
66808   240     36728   103776  without-gc-sections
60408   240     30976   91624   with-gc-sections

ERR     ERR     ERR     ERR     msb-430h
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

-22580  -32     36      -22576  msba2
148432  2432    95861   246725  without-gc-sections
125852  2400    95897   224149  with-gc-sections

-7316   0       -5760   -13076  msbiot
64248   284     37152   101684  without-gc-sections
56932   284     31392   88608   with-gc-sections

-9044   -72     -5760   -14876  mulle
68776   1364    38488   108628  without-gc-sections
59732   1292    32728   93752   with-gc-sections

0       0       0       0       native
178913  672     253964  433549  without-gc-sections
178913  672     253964  433549  with-gc-sections

ERR     ERR     ERR     ERR     redbee-econotag
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     samr21-xpro
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     telosb
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_3b
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     wsn430-v1_4
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

ERR     ERR     ERR     ERR     z1
ERR     ERR     ERR     ERR     without-gc-sections
ERR     ERR     ERR     ERR     with-gc-sections

make: Leaving directory '/home/kim/work/src/riot/examples/rpl_udp'

@jnohlgard
Copy link
Copy Markdown
Member Author

(a PR for fixing the info-buildsizes makefile target will be coming soon) #3358 - merged

@jnohlgard jnohlgard mentioned this pull request Jul 10, 2015
4 tasks
Currently only has the linker flag --gc-sections defined which tells
the linker to omit dead code. Depending on the application this leads
to significant reduction of code size.
@thomaseichinger
Copy link
Copy Markdown
Member

This should be fairly low-risk when building without LTO.

@gebart Should introduce a warning in case LTO is enabled too? Unit it is save to use together? (#3361)

@jnohlgard
Copy link
Copy Markdown
Member Author

@thomaseichinger LTO builds are broken on many platforms already... I'll add a warning for LTO in general

@jnohlgard jnohlgard force-pushed the pr/adopted/add_gc branch 2 times, most recently from dd72791 to a624412 Compare July 13, 2015 13:36
@jnohlgard
Copy link
Copy Markdown
Member Author

Rebased, opened #3376 for the warning

@thomaseichinger
Copy link
Copy Markdown
Member

ACK when Travis passed (again) and #3376 is merged.

@OlegHahm
Copy link
Copy Markdown
Member

Why is Strider taking longer than Travis to test this?

jnohlgard pushed a commit that referenced this pull request Jul 13, 2015
make: build with linker garbage collection
@jnohlgard jnohlgard merged commit f8a8e69 into RIOT-OS:master Jul 13, 2015
@jnohlgard jnohlgard deleted the pr/adopted/add_gc branch July 13, 2015 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants