Browse Source

gcc: Support only the latest branch releases of gcc

This change, as per #222, reduces the number of supported releases of
gcc to the latest branch releases.

I noticed while doing this work that gcc-4.5.4 was never added, so I
moved patches for gcc-4.5.3 to 4.5.4 and updated the
bfin-unknown-linux-uclibc example. Also, 120-siginfo.patch was fixed
upstream in the 4.5.4 release, so this patch is omitted.

I also bumped the avr sample to 4.9.3 from 4.9.2.

With the addition of gcc-5.x, the gcc release team now releases the
major.minor.0 versions, while updates to the branch are available in
svn/git. We'll address that when we get to issue #219. This change just
removes CC_GCC_5_1 and moves CC_GCC_5_2 to CC_GCC_5, and removes
CC_GCC_5_1_or_later and moves CC_GCC_5_2_or_later to CC_GCC_5_or_later.

This is the first of two part changes, as mentioned in #222.
This change is slated for release in 1.22.0. The next change will be
slated for 1.23.0, and will limit gcc versions to what is on
https://gcc.gnu.org under "Release Series and Status", which is
currently 4.9.3 and 5.2.0, although I will also support the previous
supported version. In this example that would be 4.8.5.

Last, but not least, this change also retires AVR32 support.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
1.22
Bryan Hundven 7 years ago
parent
commit
1a25115a18
  1. 1
      TODO
  2. 13
      config/arch/avr32.in
  3. 256
      config/cc/gcc.in
  4. 6
      config/companion_libs/isl.in
  5. 13
      config/libc/newlib.in
  6. 52747
      patches/binutils/2.18a/130-avr32-atmel-v1.0.1.patch
  7. 536
      patches/binutils/2.25.1/avr/0001-AVR-only-support-C-for-AVR-memory-usage.patch
  8. 536
      patches/binutils/2.25/avr/0001-AVR-only-support-C-for-AVR-memory-usage.patch
  9. 492
      patches/gcc/3.4.6/100-uclibc-conf.patch
  10. 3255
      patches/gcc/3.4.6/110-uclibc-locale.patch
  11. 46
      patches/gcc/3.4.6/120-libstdc++-pic.patch
  12. 26
      patches/gcc/3.4.6/130-index_macro.patch
  13. 68
      patches/gcc/3.4.6/140-arm-ldm-peephole.patch
  14. 120
      patches/gcc/3.4.6/150-arm-ldm.patch
  15. 32
      patches/gcc/3.4.6/160-arm-ldm-peephole2.patch
  16. 24
      patches/gcc/3.4.6/170-sdk-libstdc++-includes.patch
  17. 27
      patches/gcc/3.4.6/180-pr15068-fix.patch
  18. 44
      patches/gcc/3.4.6/190-all_sh-pr16665-fix.patch
  19. 14
      patches/gcc/3.4.6/200-all_sh-no-reorder-blocks.patch
  20. 24
      patches/gcc/3.4.6/210-all_sh-pr20617.patch
  21. 65
      patches/gcc/3.4.6/220-arm-bigendian.patch
  22. 16
      patches/gcc/3.4.6/230-powerpc-libc_stack_end-uclibc.patch
  23. 7
      patches/gcc/3.4.6/240-mips-xgot.patch
  24. 10231
      patches/gcc/3.4.6/250-nios2.patch
  25. 161
      patches/gcc/3.4.6/260-arm-softfloat.patch
  26. 553
      patches/gcc/4.0.4/100-uclibc-conf.patch
  27. 3237
      patches/gcc/4.0.4/110-uclibc-locale.patch
  28. 45
      patches/gcc/4.0.4/120-libstdc++-pic.patch
  29. 11
      patches/gcc/4.0.4/130-missing-execinfo_h.patch
  30. 11
      patches/gcc/4.0.4/140-c99-snprintf.patch
  31. 12
      patches/gcc/4.0.4/150-c99-complex-ugly-hack.patch
  32. 24
      patches/gcc/4.0.4/160-index_macro.patch
  33. 49
      patches/gcc/4.0.4/170-libmudflap-susv3-legacy.patch
  34. 22
      patches/gcc/4.0.4/180-sdk-libstdc++-includes.patch
  35. 65
      patches/gcc/4.0.4/190-arm-bigendian.patch
  36. 15
      patches/gcc/4.0.4/200-arm-softfloat.patch
  37. 544
      patches/gcc/4.1.2/100-uclibc-conf.patch
  38. 25
      patches/gcc/4.1.2/110-arm-eabi.patch
  39. 3239
      patches/gcc/4.1.2/120-uclibc-locale.patch
  40. 48
      patches/gcc/4.1.2/130-libstdc++-pic.patch
  41. 11
      patches/gcc/4.1.2/140-missing-execinfo_h.patch
  42. 11
      patches/gcc/4.1.2/150-c99-snprintf.patch
  43. 12
      patches/gcc/4.1.2/160-c99-complex-ugly-hack.patch
  44. 24
      patches/gcc/4.1.2/170-index_macro.patch
  45. 11
      patches/gcc/4.1.2/180-libbackend_dep_gcov-iov.h.patch
  46. 22
      patches/gcc/4.1.2/190-sh-pr24836.patch
  47. 114
      patches/gcc/4.1.2/200-arm-bigendian.patch
  48. 58
      patches/gcc/4.1.2/210-softfloat-fix.patch
  49. 200
      patches/gcc/4.2.0/100-uclibc-conf.patch
  50. 11
      patches/gcc/4.2.0/110-uclibc-conf-noupstream.patch
  51. 2790
      patches/gcc/4.2.0/120-uclibc-locale.patch
  52. 213
      patches/gcc/4.2.0/130-uclibc-locale-no__x.patch
  53. 48
      patches/gcc/4.2.0/140-uclibc-locale-wchar_fix.patch
  54. 347
      patches/gcc/4.2.0/150-uclibc-locale-update.patch
  55. 50
      patches/gcc/4.2.0/160-libstdc++-pic.patch
  56. 11
      patches/gcc/4.2.0/170-missing-execinfo_h.patch
  57. 11
      patches/gcc/4.2.0/180-c99-snprintf.patch
  58. 12
      patches/gcc/4.2.0/190-c99-complex-ugly-hack.patch
  59. 24
      patches/gcc/4.2.0/200-index_macro.patch
  60. 49
      patches/gcc/4.2.0/210-libmudflap-susv3-legacy.patch
  61. 36
      patches/gcc/4.2.0/220-libstdc++-namespace.patch
  62. 13
      patches/gcc/4.2.0/230-libbackend_dep_gcov-iov.h.patch
  63. 67
      patches/gcc/4.2.0/240-arm-bigendian.patch
  64. 58
      patches/gcc/4.2.0/250-softfloat-fix.patch
  65. 153
      patches/gcc/4.2.0/260-flatten-switch-stmt-00.patch
  66. 21
      patches/gcc/4.2.0/270-soft-float.patch
  67. 17
      patches/gcc/4.2.0/280-alpha-signal_h.patch
  68. 26
      patches/gcc/4.2.0/290-sh-without-headers.patch
  69. 32
      patches/gcc/4.2.0/300-libgcc_eh.a.patch
  70. 216
      patches/gcc/4.2.1/100-uclibc-conf.patch
  71. 12
      patches/gcc/4.2.1/110-uclibc-conf-noupstream.patch
  72. 2806
      patches/gcc/4.2.1/120-uclibc-locale.patch
  73. 223
      patches/gcc/4.2.1/130-uclibc-locale-no__x.patch
  74. 50
      patches/gcc/4.2.1/140-uclibc-locale-wchar_fix.patch
  75. 354
      patches/gcc/4.2.1/150-uclibc-locale-update.patch
  76. 50
      patches/gcc/4.2.1/160-libstdc++-pic.patch
  77. 12
      patches/gcc/4.2.1/170-missing-execinfo_h.patch
  78. 12
      patches/gcc/4.2.1/180-c99-snprintf.patch
  79. 13
      patches/gcc/4.2.1/190-c99-complex-ugly-hack.patch
  80. 26
      patches/gcc/4.2.1/200-index_macro.patch
  81. 48
      patches/gcc/4.2.1/210-libmudflap-susv3-legacy.patch
  82. 36
      patches/gcc/4.2.1/220-libstdc++-namespace.patch
  83. 12
      patches/gcc/4.2.1/230-libbackend_dep_gcov-iov.h.patch
  84. 64
      patches/gcc/4.2.1/240-arm-bigendian.patch
  85. 58
      patches/gcc/4.2.1/250-softfloat-fix.patch
  86. 24
      patches/gcc/4.2.1/260-flatten-switch-stmt-00.patch
  87. 21
      patches/gcc/4.2.1/270-soft-float.patch
  88. 17
      patches/gcc/4.2.1/280-alpha-signal_h.patch
  89. 26
      patches/gcc/4.2.1/290-sh-without-headers.patch
  90. 21
      patches/gcc/4.2.1/300-libstdc++-nostdlib-linking.patch
  91. 32
      patches/gcc/4.2.1/310-libgcc_eh.a.patch
  92. 216
      patches/gcc/4.2.2/100-uclibc-conf.patch
  93. 12
      patches/gcc/4.2.2/110-uclibc-conf-noupstream.patch
  94. 2806
      patches/gcc/4.2.2/120-uclibc-locale.patch
  95. 223
      patches/gcc/4.2.2/130-uclibc-locale-no__x.patch
  96. 50
      patches/gcc/4.2.2/140-uclibc-locale-wchar_fix.patch
  97. 354
      patches/gcc/4.2.2/150-uclibc-locale-update.patch
  98. 50
      patches/gcc/4.2.2/160-libstdc++-pic.patch
  99. 12
      patches/gcc/4.2.2/170-missing-execinfo_h.patch
  100. 12
      patches/gcc/4.2.2/180-c99-snprintf.patch
  101. Some files were not shown because too many files have changed in this diff Show More

1
TODO

@ -10,7 +10,6 @@ Recurring tasks:
Non-recurring tasks:
- update newlib (for enhanced bare metal)
- confirm existing implementation on targets other than AVR32
- try to make it generic, will help for uClibc++
- multilib

13
config/arch/avr32.in

@ -1,13 +0,0 @@
# AVR32 specific configuration file
## select ARCH_SUPPORTS_32
## select ARCH_DEFAULT_32
## select ARCH_USE_MMU
## select ARCH_DEFAULT_BE
## select ARCH_SUPPORTS_WITH_ARCH
## select ARCH_SUPPORTS_WITH_CPU
## select ARCH_SUPPORTS_WITH_TUNE
## select ARCH_SUPPORTS_WITH_FPU
##
## help The AVR32 architecture, as defined by:
## help http://www.atmel.com/products/avr32

256
config/cc/gcc.in

@ -40,12 +40,7 @@ choice
config CC_GCC_V_5_2_0
bool
prompt "5.2.0"
select CC_GCC_5_2
config CC_GCC_V_5_1_0
bool
prompt "5.1.0"
select CC_GCC_5_1
select CC_GCC_5
config CC_GCC_V_linaro_4_9
bool
@ -58,21 +53,6 @@ config CC_GCC_V_4_9_3
prompt "4.9.3"
select CC_GCC_4_9
config CC_GCC_V_4_9_2
bool
prompt "4.9.2"
select CC_GCC_4_9
config CC_GCC_V_4_9_1
bool
prompt "4.9.1"
select CC_GCC_4_9
config CC_GCC_V_4_9_0
bool
prompt "4.9.0"
select CC_GCC_4_9
config CC_GCC_V_linaro_4_8
bool
prompt "linaro-4.8-2015.06"
@ -84,31 +64,6 @@ config CC_GCC_V_4_8_5
prompt "4.8.5"
select CC_GCC_4_8
config CC_GCC_V_4_8_4
bool
prompt "4.8.4"
select CC_GCC_4_8
config CC_GCC_V_4_8_3
bool
prompt "4.8.3"
select CC_GCC_4_8
config CC_GCC_V_4_8_2
bool
prompt "4.8.2"
select CC_GCC_4_8
config CC_GCC_V_4_8_1
bool
prompt "4.8.1"
select CC_GCC_4_8
config CC_GCC_V_4_8_0
bool
prompt "4.8.0"
select CC_GCC_4_8
config CC_GCC_V_linaro_4_7
bool
prompt "linaro-4.7-2014.06"
@ -120,26 +75,6 @@ config CC_GCC_V_4_7_4
prompt "4.7.4"
select CC_GCC_4_7
config CC_GCC_V_4_7_3
bool
prompt "4.7.3"
select CC_GCC_4_7
config CC_GCC_V_4_7_2
bool
prompt "4.7.2"
select CC_GCC_4_7
config CC_GCC_V_4_7_1
bool
prompt "4.7.1"
select CC_GCC_4_7
config CC_GCC_V_4_7_0
bool
prompt "4.7.0"
select CC_GCC_4_7
config CC_GCC_V_linaro_4_6
bool
prompt "linaro-4.6-2013.05"
@ -151,50 +86,15 @@ config CC_GCC_V_4_6_4
prompt "4.6.4"
select CC_GCC_4_6
config CC_GCC_V_4_6_3
bool
prompt "4.6.3"
select CC_GCC_4_6
config CC_GCC_V_4_6_2
bool
prompt "4.6.2"
select CC_GCC_4_6
config CC_GCC_V_4_6_1
bool
prompt "4.6.1"
select CC_GCC_4_6
config CC_GCC_V_4_6_0
bool
prompt "4.6.0"
select CC_GCC_4_6
config CC_GCC_V_linaro_4_5
bool
prompt "linaro-4.5-2012.03"
depends on CC_GCC_SHOW_LINARO
select CC_GCC_4_5
config CC_GCC_V_4_5_3
bool
prompt "4.5.3"
select CC_GCC_4_5
config CC_GCC_V_4_5_2
config CC_GCC_V_4_5_4
bool
prompt "4.5.2"
select CC_GCC_4_5
config CC_GCC_V_4_5_1
bool
prompt "4.5.1"
select CC_GCC_4_5
config CC_GCC_V_4_5_0
bool
prompt "4.5.0"
prompt "4.5.4"
select CC_GCC_4_5
config CC_GCC_V_linaro_4_4
@ -208,98 +108,16 @@ config CC_GCC_V_4_4_7
prompt "4.4.7"
select CC_GCC_4_4
config CC_GCC_V_4_4_6
bool
prompt "4.4.6"
select CC_GCC_4_4
config CC_GCC_V_4_4_5
bool
prompt "4.4.5"
select CC_GCC_4_4
config CC_GCC_V_4_4_4
bool
prompt "4.4.4"
select CC_GCC_4_4
config CC_GCC_V_4_4_3
bool
prompt "4.4.3"
select CC_GCC_4_4
config CC_GCC_V_4_4_2
bool
prompt "4.4.2"
select CC_GCC_4_4
config CC_GCC_V_4_4_1
bool
prompt "4.4.1"
select CC_GCC_4_4
config CC_GCC_V_4_4_0
bool
prompt "4.4.0"
select CC_GCC_4_4
config CC_GCC_V_4_3_6
bool
prompt "4.3.6"
select CC_GCC_4_3
config CC_GCC_V_4_3_5
bool
prompt "4.3.5"
select CC_GCC_4_3
config CC_GCC_V_4_3_4
bool
prompt "4.3.4"
select CC_GCC_4_3
config CC_GCC_V_4_3_3
bool
prompt "4.3.3"
select CC_GCC_4_3
config CC_GCC_V_4_3_2
bool
prompt "4.3.2"
select CC_GCC_4_3
config CC_GCC_V_4_3_1
bool
prompt "4.3.1"
select CC_GCC_4_3
config CC_GCC_V_4_2_4
bool
prompt "4.2.4"
select CC_GCC_4_2
# We need that one, it's the only version with avr32 support
# because we have a patch for it
config CC_GCC_V_4_2_2
bool
prompt "4.2.2"
select CC_GCC_4_2
config CC_GCC_V_4_1_2
bool
prompt "4.1.2 (OBSOLETE)"
depends on OBSOLETE
config CC_GCC_V_4_0_4
bool
prompt "4.0.4 (OBSOLETE)"
depends on OBSOLETE
config CC_GCC_V_3_4_6
bool
prompt "3.4.6 (OBSOLETE)"
depends on OBSOLETE
endchoice
config CC_GCC_CUSTOM
@ -431,9 +249,9 @@ config CC_GCC_4_9_or_later
bool
select CC_GCC_4_8_or_later
config CC_GCC_5_2
config CC_GCC_5
bool
select CC_GCC_5_2_or_later
select CC_GCC_5_or_later
select CC_GCC_USE_GMP_MPFR
select CC_GCC_USE_MPC
select CC_GCC_HAS_GRAPHITE
@ -445,31 +263,14 @@ config CC_GCC_5_2
select CC_GCC_HAS_LIBSANITIZER
select CC_SUPPORT_GOLANG
config CC_GCC_5_2_or_later
bool
select CC_GCC_5_1_or_later
config CC_GCC_5_1
bool
select CC_GCC_5_1_or_later
select CC_GCC_USE_GMP_MPFR
select CC_GCC_USE_MPC
select CC_GCC_HAS_GRAPHITE
select CC_GCC_HAS_LTO
select CC_GCC_HAS_PKGVERSION_BUGURL
select CC_GCC_HAS_BUILD_ID
select CC_GCC_HAS_LNK_HASH_STYLE
select CC_GCC_HAS_LIBQUADMATH
select CC_GCC_HAS_LIBSANITIZER
select CC_SUPPORT_GOLANG
config CC_GCC_5_1_or_later
config CC_GCC_5_or_later
bool
select CC_GCC_4_9_or_later
config CC_GCC_latest
bool
select CC_GCC_5_1_or_later
select CC_GCC_5_or_later
select CC_GCC_USE_GMP_MPFR
select CC_GCC_USE_MPC
select CC_GCC_HAS_GRAPHITE
@ -489,7 +290,7 @@ config CC_GCC_USE_GRAPHITE
bool
default y
depends on CC_GCC_HAS_GRAPHITE
select CLOOG_NEEDED if !CC_GCC_5_1_or_later
select CLOOG_NEEDED if !CC_GCC_5_or_later
select PPL_NEEDED if !CC_GCC_4_8_or_later
select ISL_NEEDED if CC_GCC_4_8_or_later
help
@ -567,57 +368,20 @@ config CC_GCC_VERSION
# Don't remove next line
# CT_INSERT_VERSION_STRING_BELOW
default "5.2.0" if CC_GCC_V_5_2_0
default "5.1.0" if CC_GCC_V_5_1_0
default "linaro-4.9-2015.06" if CC_GCC_V_linaro_4_9
default "4.9.3" if CC_GCC_V_4_9_3
default "4.9.2" if CC_GCC_V_4_9_2
default "4.9.1" if CC_GCC_V_4_9_1
default "4.9.0" if CC_GCC_V_4_9_0
default "linaro-4.8-2015.06" if CC_GCC_V_linaro_4_8
default "4.8.5" if CC_GCC_V_4_8_5
default "4.8.4" if CC_GCC_V_4_8_4
default "4.8.3" if CC_GCC_V_4_8_3
default "4.8.2" if CC_GCC_V_4_8_2
default "4.8.1" if CC_GCC_V_4_8_1
default "4.8.0" if CC_GCC_V_4_8_0
default "linaro-4.7-2014.06" if CC_GCC_V_linaro_4_7
default "4.7.4" if CC_GCC_V_4_7_4
default "4.7.3" if CC_GCC_V_4_7_3
default "4.7.2" if CC_GCC_V_4_7_2
default "4.7.1" if CC_GCC_V_4_7_1
default "4.7.0" if CC_GCC_V_4_7_0
default "linaro-4.6-2013.05" if CC_GCC_V_linaro_4_6
default "4.6.4" if CC_GCC_V_4_6_4
default "4.6.3" if CC_GCC_V_4_6_3
default "4.6.2" if CC_GCC_V_4_6_2
default "4.6.1" if CC_GCC_V_4_6_1
default "4.6.0" if CC_GCC_V_4_6_0
default "linaro-4.5-2012.03" if CC_GCC_V_linaro_4_5
default "4.5.3" if CC_GCC_V_4_5_3
default "4.5.2" if CC_GCC_V_4_5_2
default "4.5.1" if CC_GCC_V_4_5_1
default "4.5.0" if CC_GCC_V_4_5_0
default "4.5.4" if CC_GCC_V_4_5_4
default "linaro-4.4-2011.02-0" if CC_GCC_V_linaro_4_4
default "4.4.7" if CC_GCC_V_4_4_7
default "4.4.6" if CC_GCC_V_4_4_6
default "4.4.5" if CC_GCC_V_4_4_5
default "4.4.4" if CC_GCC_V_4_4_4
default "4.4.3" if CC_GCC_V_4_4_3
default "4.4.2" if CC_GCC_V_4_4_2
default "4.4.1" if CC_GCC_V_4_4_1
default "4.4.0" if CC_GCC_V_4_4_0
default "4.3.6" if CC_GCC_V_4_3_6
default "4.3.5" if CC_GCC_V_4_3_5
default "4.3.4" if CC_GCC_V_4_3_4
default "4.3.3" if CC_GCC_V_4_3_3
default "4.3.2" if CC_GCC_V_4_3_2
default "4.3.1" if CC_GCC_V_4_3_1
default "4.3.0" if CC_GCC_V_4_3_0
default "4.2.4" if CC_GCC_V_4_2_4
default "4.2.2" if CC_GCC_V_4_2_2
default "4.1.2" if CC_GCC_V_4_1_2
default "4.0.4" if CC_GCC_V_4_0_4
default "3.4.6" if CC_GCC_V_3_4_6
config CC_LANG_JAVA_USE_ECJ
bool

6
config/companion_libs/isl.in

@ -9,20 +9,20 @@ choice
config ISL_V_0_14
bool
prompt "0.14"
depends on CLOOG_0_18_4_or_later || CC_GCC_5_1_or_later
depends on CLOOG_0_18_4_or_later || CC_GCC_5_or_later
select ISL_V_0_14_or_later
config ISL_V_0_12_2
bool
prompt "0.12.2"
depends on ! CLOOG_0_18_4_or_later || CC_GCC_5_1_or_later
depends on ! CLOOG_0_18_4_or_later || CC_GCC_5_or_later
select ISL_V_0_12_or_later
config ISL_V_0_11_1
bool
prompt "0.11.1"
depends on ! CLOOG_0_18_4_or_later
depends on ! CC_GCC_5_1_or_later
depends on ! CC_GCC_5_or_later
endchoice

13
config/libc/newlib.in

@ -157,16 +157,3 @@ config LIBC_NEWLIB_TARGET_CFLAGS
to compile the libraries.
Leave blank if you don't know better.
comment "Architecture specific options"
config ATMEL_AVR32_HEADERS
bool
prompt "Install Atmel AVR32 headers"
depends on ARCH_avr32
default y
help
Install Atmel AVR32 headers for native AVR32 development. Most
AVR32 MCU devices are supported.
If you do native AVR32 development you want to say 'Y' here.

52747
patches/binutils/2.18a/130-avr32-atmel-v1.0.1.patch

File diff suppressed because it is too large Load Diff

536
patches/binutils/2.25.1/avr/0001-AVR-only-support-C-for-AVR-memory-usage.patch

@ -1,536 +0,0 @@
From 55e9a09c2249f3d5bbc09d718679365604436aac Mon Sep 17 00:00:00 2001
From: Erico Nunes <nunes.erico@gmail.com>
Date: Sat, 13 Jun 2015 00:53:25 -0300
Subject: [PATCH] AVR only; support -C for AVR memory usage
Source: http://git.makehackvoid.com/cgi-bin/gitweb.cgi?p=mhvavrtools.git;a=blob_plain;f=mhvavrtools/patches/binutils-001-avr-size.patch;h=e80d28eae46217551d996a2253256c97d10aa4b5;hb=refs/heads/master
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
---
binutils/size.c | 414 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 394 insertions(+), 20 deletions(-)
diff --git a/binutils/size.c b/binutils/size.c
index 0937de5..486ddde 100644
--- a/binutils/size.c
+++ b/binutils/size.c
@@ -36,10 +36,31 @@
#include "getopt.h"
#include "bucomm.h"
-#ifndef BSD_DEFAULT
-#define BSD_DEFAULT 1
+typedef enum
+{
+ format_sysv = 0,
+ format_bsd = 1,
+ format_avr = 2,
+} format_type_t;
+
+
+/* Set the default format. */
+#define FORMAT_DEFAULT_SYSV 0
+#define FORMAT_DEFAULT_BSD 1
+#define FORMAT_DEFAULT_AVR 0
+
+#if FORMAT_DEFAULT_SYSV
+ #define FORMAT_DEFAULT format_sysv
+ #define FORMAT_NAME "sysv"
+#elif FORMAT_DEFAULT_BSD
+ #define FORMAT_DEFAULT format_bsd
+ #define FORMAT_NAME "berkeley"
+#elif FORMAT_DEFAULT_AVR
+ #define FORMAT_DEFAULT format_avr
+ #define FORMAT_NAME "avr"
#endif
+
/* Program options. */
static enum
@@ -48,9 +69,8 @@ static enum
}
radix = decimal;
-/* 0 means use AT&T-style output. */
-static int berkeley_format = BSD_DEFAULT;
+format_type_t format = FORMAT_DEFAULT;
static int show_version = 0;
static int show_help = 0;
static int show_totals = 0;
@@ -64,6 +84,246 @@ static bfd_size_type total_textsize;
/* Program exit status. */
static int return_code = 0;
+
+/* AVR Size specific stuff */
+
+#define AVR64 64UL
+#define AVR128 128UL
+#define AVR256 256UL
+#define AVR512 512UL
+#define AVR1K 1024UL
+#define AVR2K 2048UL
+#define AVR4K 4096UL
+#define AVR8K 8192UL
+#define AVR16K 16384UL
+#define AVR20K 20480UL
+#define AVR24K 24576UL
+#define AVR32K 32768UL
+#define AVR36K 36864UL
+#define AVR40K 40960UL
+#define AVR64K 65536UL
+#define AVR68K 69632UL
+#define AVR128K 131072UL
+#define AVR136K 139264UL
+#define AVR200K 204800UL
+#define AVR256K 262144UL
+#define AVR264K 270336UL
+
+typedef struct
+{
+ char *name;
+ long flash;
+ long ram;
+ long eeprom;
+} avr_device_t;
+
+avr_device_t avr[] =
+{
+ {"atxmega256a3", AVR264K, AVR16K, AVR4K},
+ {"atxmega256a3b", AVR264K, AVR16K, AVR4K},
+ {"atxmega256d3", AVR264K, AVR16K, AVR4K},
+
+ {"atmega2560", AVR256K, AVR8K, AVR4K},
+ {"atmega2561", AVR256K, AVR8K, AVR4K},
+
+ {"atxmega192a3", AVR200K, AVR16K, AVR2K},
+ {"atxmega192d3", AVR200K, AVR16K, AVR2K},
+
+ {"atxmega128a1", AVR136K, AVR8K, AVR2K},
+ {"atxmega128a1u", AVR136K, AVR8K, AVR2K},
+ {"atxmega128a3", AVR136K, AVR8K, AVR2K},
+ {"atxmega128d3", AVR136K, AVR8K, AVR2K},
+
+ {"at43usb320", AVR128K, 608UL, 0UL},
+ {"at90can128", AVR128K, AVR4K, AVR4K},
+ {"at90usb1286", AVR128K, AVR8K, AVR4K},
+ {"at90usb1287", AVR128K, AVR8K, AVR4K},
+ {"atmega128", AVR128K, AVR4K, AVR4K},
+ {"atmega1280", AVR128K, AVR8K, AVR4K},
+ {"atmega1281", AVR128K, AVR8K, AVR4K},
+ {"atmega1284p", AVR128K, AVR16K, AVR4K},
+ {"atmega128rfa1", AVR128K, AVR16K, AVR4K},
+ {"atmega103", AVR128K, 4000UL, AVR4K},
+
+ {"atxmega64a1", AVR68K, AVR4K, AVR2K},
+ {"atxmega64a1u", AVR68K, AVR4K, AVR2K},
+ {"atxmega64a3", AVR68K, AVR4K, AVR2K},
+ {"atxmega64d3", AVR68K, AVR4K, AVR2K},
+
+ {"at90can64", AVR64K, AVR4K, AVR2K},
+ {"at90scr100", AVR64K, AVR4K, AVR2K},
+ {"at90usb646", AVR64K, AVR4K, AVR2K},
+ {"at90usb647", AVR64K, AVR4K, AVR2K},
+ {"atmega64", AVR64K, AVR4K, AVR2K},
+ {"atmega640", AVR64K, AVR8K, AVR4K},
+ {"atmega644", AVR64K, AVR4K, AVR2K},
+ {"atmega644a", AVR64K, AVR4K, AVR2K},
+ {"atmega644p", AVR64K, AVR4K, AVR2K},
+ {"atmega644pa", AVR64K, AVR4K, AVR2K},
+ {"atmega645", AVR64K, AVR4K, AVR2K},
+ {"atmega645a", AVR64K, AVR4K, AVR2K},
+ {"atmega645p", AVR64K, AVR4K, AVR2K},
+ {"atmega6450", AVR64K, AVR4K, AVR2K},
+ {"atmega6450a", AVR64K, AVR4K, AVR2K},
+ {"atmega6450p", AVR64K, AVR4K, AVR2K},
+ {"atmega649", AVR64K, AVR4K, AVR2K},
+ {"atmega649a", AVR64K, AVR4K, AVR2K},
+ {"atmega649p", AVR64K, AVR4K, AVR2K},
+ {"atmega6490", AVR64K, AVR4K, AVR2K},
+ {"atmega6490a", AVR64K, AVR4K, AVR2K},
+ {"atmega6490p", AVR64K, AVR4K, AVR2K},
+ {"atmega64c1", AVR64K, AVR4K, AVR2K},
+ {"atmega64hve", AVR64K, AVR4K, AVR1K},
+ {"atmega64m1", AVR64K, AVR4K, AVR2K},
+ {"m3000", AVR64K, AVR4K, 0UL},
+
+ {"atmega406", AVR40K, AVR2K, AVR512},
+
+ {"atxmega32a4", AVR36K, AVR4K, AVR1K},
+ {"atxmega32d4", AVR36K, AVR4K, AVR1K},
+
+ {"at90can32", AVR32K, AVR2K, AVR1K},
+ {"at94k", AVR32K, AVR4K, 0UL},
+ {"atmega32", AVR32K, AVR2K, AVR1K},
+ {"atmega323", AVR32K, AVR2K, AVR1K},
+ {"atmega324a", AVR32K, AVR2K, AVR1K},
+ {"atmega324p", AVR32K, AVR2K, AVR1K},
+ {"atmega324pa", AVR32K, AVR2K, AVR1K},
+ {"atmega325", AVR32K, AVR2K, AVR1K},
+ {"atmega325a", AVR32K, AVR2K, AVR1K},
+ {"atmega325p", AVR32K, AVR2K, AVR1K},
+ {"atmega3250", AVR32K, AVR2K, AVR1K},
+ {"atmega3250a", AVR32K, AVR2K, AVR1K},
+ {"atmega3250p", AVR32K, AVR2K, AVR1K},
+ {"atmega328", AVR32K, AVR2K, AVR1K},
+ {"atmega328p", AVR32K, AVR2K, AVR1K},
+ {"atmega329", AVR32K, AVR2K, AVR1K},
+ {"atmega329a", AVR32K, AVR2K, AVR1K},
+ {"atmega329p", AVR32K, AVR2K, AVR1K},
+ {"atmega329pa", AVR32K, AVR2K, AVR1K},
+ {"atmega3290", AVR32K, AVR2K, AVR1K},
+ {"atmega3290a", AVR32K, AVR2K, AVR1K},
+ {"atmega3290p", AVR32K, AVR2K, AVR1K},
+ {"atmega32hvb", AVR32K, AVR2K, AVR1K},
+ {"atmega32c1", AVR32K, AVR2K, AVR1K},
+ {"atmega32hvb", AVR32K, AVR2K, AVR1K},
+ {"atmega32m1", AVR32K, AVR2K, AVR1K},
+ {"atmega32u2", AVR32K, AVR1K, AVR1K},
+ {"atmega32u4", AVR32K, 2560UL, AVR1K},
+ {"atmega32u6", AVR32K, 2560UL, AVR1K},
+
+ {"at43usb355", AVR24K, 1120UL, 0UL},
+
+ {"atxmega16a4", AVR20K, AVR2K, AVR1K},
+ {"atxmega16d4", AVR20K, AVR2K, AVR1K},
+
+ {"at76c711", AVR16K, AVR2K, 0UL},
+ {"at90pwm216", AVR16K, AVR1K, AVR512},
+ {"at90pwm316", AVR16K, AVR1K, AVR512},
+ {"at90usb162", AVR16K, AVR512, AVR512},
+ {"atmega16", AVR16K, AVR1K, AVR512},
+ {"atmega16a", AVR16K, AVR1K, AVR512},
+ {"atmega161", AVR16K, AVR1K, AVR512},
+ {"atmega162", AVR16K, AVR1K, AVR512},
+ {"atmega163", AVR16K, AVR1K, AVR512},
+ {"atmega164", AVR16K, AVR1K, AVR512},
+ {"atmega164a", AVR16K, AVR1K, AVR512},
+ {"atmega164p", AVR16K, AVR1K, AVR512},
+ {"atmega165a", AVR16K, AVR1K, AVR512},
+ {"atmega165", AVR16K, AVR1K, AVR512},
+ {"atmega165p", AVR16K, AVR1K, AVR512},
+ {"atmega168", AVR16K, AVR1K, AVR512},
+ {"atmega168a", AVR16K, AVR1K, AVR512},
+ {"atmega168p", AVR16K, AVR1K, AVR512},
+ {"atmega169", AVR16K, AVR1K, AVR512},
+ {"atmega169a", AVR16K, AVR1K, AVR512},
+ {"atmega169p", AVR16K, AVR1K, AVR512},
+ {"atmega169pa", AVR16K, AVR1K, AVR512},
+ {"atmega16hva", AVR16K, 768UL, AVR256},
+ {"atmega16hva2", AVR16K, AVR1K, AVR256},
+ {"atmega16hvb", AVR16K, AVR1K, AVR512},
+ {"atmega16m1", AVR16K, AVR1K, AVR512},
+ {"atmega16u2", AVR16K, AVR512, AVR512},
+ {"atmega16u4", AVR16K, 1280UL, AVR512},
+ {"attiny167", AVR16K, AVR512, AVR512},
+
+ {"at90c8534", AVR8K, 352UL, AVR512},
+ {"at90pwm1", AVR8K, AVR512, AVR512},
+ {"at90pwm2", AVR8K, AVR512, AVR512},
+ {"at90pwm2b", AVR8K, AVR512, AVR512},
+ {"at90pwm3", AVR8K, AVR512, AVR512},
+ {"at90pwm3b", AVR8K, AVR512, AVR512},
+ {"at90pwm81", AVR8K, AVR256, AVR512},
+ {"at90s8515", AVR8K, AVR512, AVR512},
+ {"at90s8535", AVR8K, AVR512, AVR512},
+ {"at90usb82", AVR8K, AVR512, AVR512},
+ {"ata6289", AVR8K, AVR512, 320UL},
+ {"atmega8", AVR8K, AVR1K, AVR512},
+ {"atmega8515", AVR8K, AVR512, AVR512},
+ {"atmega8535", AVR8K, AVR512, AVR512},
+ {"atmega88", AVR8K, AVR1K, AVR512},
+ {"atmega88a", AVR8K, AVR1K, AVR512},
+ {"atmega88p", AVR8K, AVR1K, AVR512},
+ {"atmega88pa", AVR8K, AVR1K, AVR512},
+ {"atmega8hva", AVR8K, 768UL, AVR256},
+ {"atmega8u2", AVR8K, AVR512, AVR512},
+ {"attiny84", AVR8K, AVR512, AVR512},
+ {"attiny84a", AVR8K, AVR512, AVR512},
+ {"attiny85", AVR8K, AVR512, AVR512},
+ {"attiny861", AVR8K, AVR512, AVR512},
+ {"attiny861a", AVR8K, AVR512, AVR512},
+ {"attiny87", AVR8K, AVR512, AVR512},
+ {"attiny88", AVR8K, AVR512, AVR64},
+
+ {"at90s4414", AVR4K, 352UL, AVR256},
+ {"at90s4433", AVR4K, AVR128, AVR256},
+ {"at90s4434", AVR4K, 352UL, AVR256},
+ {"atmega48", AVR4K, AVR512, AVR256},
+ {"atmega48a", AVR4K, AVR512, AVR256},
+ {"atmega48p", AVR4K, AVR512, AVR256},
+ {"attiny4313", AVR4K, AVR256, AVR256},
+ {"attiny43u", AVR4K, AVR256, AVR64},
+ {"attiny44", AVR4K, AVR256, AVR256},
+ {"attiny44a", AVR4K, AVR256, AVR256},
+ {"attiny45", AVR4K, AVR256, AVR256},
+ {"attiny461", AVR4K, AVR256, AVR256},
+ {"attiny461a", AVR4K, AVR256, AVR256},
+ {"attiny48", AVR4K, AVR256, AVR64},
+
+ {"at86rf401", AVR2K, 224UL, AVR128},
+ {"at90s2313", AVR2K, AVR128, AVR128},
+ {"at90s2323", AVR2K, AVR128, AVR128},
+ {"at90s2333", AVR2K, 224UL, AVR128},
+ {"at90s2343", AVR2K, AVR128, AVR128},
+ {"attiny20", AVR2K, AVR128, 0UL},
+ {"attiny22", AVR2K, 224UL, AVR128},
+ {"attiny2313", AVR2K, AVR128, AVR128},
+ {"attiny2313a", AVR2K, AVR128, AVR128},
+ {"attiny24", AVR2K, AVR128, AVR128},
+ {"attiny24a", AVR2K, AVR128, AVR128},
+ {"attiny25", AVR2K, AVR128, AVR128},
+ {"attiny26", AVR2K, AVR128, AVR128},
+ {"attiny261", AVR2K, AVR128, AVR128},
+ {"attiny261a", AVR2K, AVR128, AVR128},
+ {"attiny28", AVR2K, 0UL, 0UL},
+ {"attiny40", AVR2K, AVR256, 0UL},
+
+ {"at90s1200", AVR1K, 0UL, AVR64},
+ {"attiny9", AVR1K, 32UL, 0UL},
+ {"attiny10", AVR1K, 32UL, 0UL},
+ {"attiny11", AVR1K, 0UL, AVR64},
+ {"attiny12", AVR1K, 0UL, AVR64},
+ {"attiny13", AVR1K, AVR64, AVR64},
+ {"attiny13a", AVR1K, AVR64, AVR64},
+ {"attiny15", AVR1K, 0UL, AVR64},
+
+ {"attiny4", AVR512, 32UL, 0UL},
+ {"attiny5", AVR512, 32UL, 0UL},
+};
+
+static char *avrmcu = NULL;
+
+
static char *target = NULL;
/* Forward declarations. */
@@ -79,7 +339,8 @@ usage (FILE *stream, int status)
fprintf (stream, _(" Displays the sizes of sections inside binary files\n"));
fprintf (stream, _(" If no input file(s) are specified, a.out is assumed\n"));
fprintf (stream, _(" The options are:\n\
- -A|-B --format={sysv|berkeley} Select output style (default is %s)\n\
+ -A|-B|-C --format={sysv|berkeley|avr} Select output style (default is %s)\n\
+ --mcu=<avrmcu> MCU name for AVR format only\n\
-o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or hex\n\
-t --totals Display the total sizes (Berkeley only)\n\
--common Display total size for *COM* syms\n\
@@ -88,11 +349,7 @@ usage (FILE *stream, int status)
-h --help Display this information\n\
-v --version Display the program's version\n\
\n"),
-#if BSD_DEFAULT
- "berkeley"
-#else
- "sysv"
-#endif
+FORMAT_NAME
);
list_supported_targets (program_name, stream);
if (REPORT_BUGS_TO[0] && status == 0)
@@ -103,6 +360,7 @@ usage (FILE *stream, int status)
#define OPTION_FORMAT (200)
#define OPTION_RADIX (OPTION_FORMAT + 1)
#define OPTION_TARGET (OPTION_RADIX + 1)
+#define OPTION_MCU (OPTION_TARGET + 1)
static struct option long_options[] =
{
@@ -110,6 +368,7 @@ static struct option long_options[] =
{"format", required_argument, 0, OPTION_FORMAT},
{"radix", required_argument, 0, OPTION_RADIX},
{"target", required_argument, 0, OPTION_TARGET},
+ {"mcu", required_argument, 0, 203},
{"totals", no_argument, &show_totals, 1},
{"version", no_argument, &show_version, 1},
{"help", no_argument, &show_help, 1},
@@ -141,7 +400,7 @@ main (int argc, char **argv)
bfd_init ();
set_default_bfd_target ();
- while ((c = getopt_long (argc, argv, "ABHhVvdfotx", long_options,
+ while ((c = getopt_long (argc, argv, "ABCHhVvdfotx", long_options,
(int *) 0)) != EOF)
switch (c)
{
@@ -150,11 +409,15 @@ main (int argc, char **argv)
{
case 'B':
case 'b':
- berkeley_format = 1;
+ format = format_bsd;
break;
case 'S':
case 's':
- berkeley_format = 0;
+ format = format_sysv;
+ break;
+ case 'A':
+ case 'a':
+ format = format_avr;
break;
default:
non_fatal (_("invalid argument to --format: %s"), optarg);
@@ -162,6 +425,10 @@ main (int argc, char **argv)
}
break;
+ case OPTION_MCU:
+ avrmcu = optarg;
+ break;
+
case OPTION_TARGET:
target = optarg;
break;
@@ -190,11 +457,14 @@ main (int argc, char **argv)
break;
case 'A':
- berkeley_format = 0;
+ format = format_sysv;
break;
case 'B':
- berkeley_format = 1;
+ format = format_bsd;
break;
+ case 'C':
+ format = format_avr;
+ break;
case 'v':
case 'V':
show_version = 1;
@@ -240,7 +510,7 @@ main (int argc, char **argv)
for (; optind < argc;)
display_file (argv[optind++]);
- if (show_totals && berkeley_format)
+ if (show_totals && format == format_bsd)
{
bfd_size_type total = total_textsize + total_datasize + total_bsssize;
@@ -599,13 +869,117 @@ print_sysv_format (bfd *file)
printf ("\n\n");
}
+
+static avr_device_t *
+avr_find_device (void)
+{
+ unsigned int i;
+ if (avrmcu != NULL)
+ {
+ for (i = 0; i < sizeof(avr) / sizeof(avr[0]); i++)
+ {
+ if (strcmp(avr[i].name, avrmcu) == 0)
+ {
+ /* Match found */
+ return (&avr[i]);
+ }
+ }
+ }
+ return (NULL);
+}
+
+
+
+static void
+print_avr_format (bfd *file)
+{
+ char *avr_name = "Unknown";
+ int flashmax = 0;
+ int rammax = 0;
+ int eeprommax = 0;
+ asection *section;
+ bfd_size_type my_datasize = 0;
+ bfd_size_type my_textsize = 0;
+ bfd_size_type my_bsssize = 0;
+ bfd_size_type bootloadersize = 0;
+ bfd_size_type noinitsize = 0;
+ bfd_size_type eepromsize = 0;
+
+ avr_device_t *avrdevice = avr_find_device();
+ if (avrdevice != NULL)
+ {
+ avr_name = avrdevice->name;
+ flashmax = avrdevice->flash;
+ rammax = avrdevice->ram;
+ eeprommax = avrdevice->eeprom;
+ }
+
+ if ((section = bfd_get_section_by_name (file, ".data")) != NULL)
+ my_datasize = bfd_section_size (file, section);
+ if ((section = bfd_get_section_by_name (file, ".text")) != NULL)
+ my_textsize = bfd_section_size (file, section);
+ if ((section = bfd_get_section_by_name (file, ".bss")) != NULL)
+ my_bsssize = bfd_section_size (file, section);
+ if ((section = bfd_get_section_by_name (file, ".bootloader")) != NULL)
+ bootloadersize = bfd_section_size (file, section);
+ if ((section = bfd_get_section_by_name (file, ".noinit")) != NULL)
+ noinitsize = bfd_section_size (file, section);
+ if ((section = bfd_get_section_by_name (file, ".eeprom")) != NULL)
+ eepromsize = bfd_section_size (file, section);
+
+ bfd_size_type text = my_textsize + my_datasize + bootloadersize;
+ bfd_size_type data = my_datasize + my_bsssize + noinitsize;
+ bfd_size_type eeprom = eepromsize;
+
+ printf ("AVR Memory Usage\n"
+ "----------------\n"
+ "Device: %s\n\n", avr_name);
+
+ /* Text size */
+ printf ("Program:%8ld bytes", text);
+ if (flashmax > 0)
+ {
+ printf (" (%2.1f%% Full)", ((float)text / flashmax) * 100);
+ }
+ printf ("\n(.text + .data + .bootloader)\n\n");
+
+ /* Data size */
+ printf ("Data: %8ld bytes", data);
+ if (rammax > 0)
+ {
+ printf (" (%2.1f%% Full)", ((float)data / rammax) * 100);
+ }
+ printf ("\n(.data + .bss + .noinit)\n\n");
+
+ /* EEPROM size */
+ if (eeprom > 0)
+ {
+ printf ("EEPROM: %8ld bytes", eeprom);
+ if (eeprommax > 0)
+ {
+ printf (" (%2.1f%% Full)", ((float)eeprom / eeprommax) * 100);
+ }
+ printf ("\n(.eeprom)\n\n");
+ }
+}
+
+
static void
print_sizes (bfd *file)
{
if (show_common)
calculate_common_size (file);
- if (berkeley_format)
- print_berkeley_format (file);
- else
- print_sysv_format (file);
+ switch (format)
+ {
+ case format_sysv:
+ print_sysv_format (file);
+ break;
+ case format_bsd:
+ print_berkeley_format (file);
+ break;
+ case format_avr:
+ default:
+ print_avr_format (file);
+ break;
+ }
}
--
2.4.1

536
patches/binutils/2.25/avr/0001-AVR-only-support-C-for-AVR-memory-usage.patch

@ -1,536 +0,0 @@
From 55e9a09c2249f3d5bbc09d718679365604436aac Mon Sep 17 00:00:00 2001
From: Erico Nunes <nunes.erico@gmail.com>
Date: Sat, 13 Jun 2015 00:53:25 -0300
Subject: [PATCH] AVR only; support -C for AVR memory usage
Source: http://git.makehackvoid.com/cgi-bin/gitweb.cgi?p=mhvavrtools.git;a=blob_plain;f=mhvavrtools/patches/binutils-001-avr-size.patch;h=e80d28eae46217551d996a2253256c97d10aa4b5;hb=refs/heads/master
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
---
binutils/size.c | 414 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 394 insertions(+), 20 deletions(-)
diff --git a/binutils/size.c b/binutils/size.c
index 0937de5..486ddde 100644
--- a/binutils/size.c
+++ b/binutils/size.c
@@ -36,10 +36,31 @@
#include "getopt.h"
#include "bucomm.h"
-#ifndef BSD_DEFAULT
-#define BSD_DEFAULT 1
+typedef enum
+{
+ format_sysv = 0,
+ format_bsd = 1,
+ format_avr = 2,
+} format_type_t;
+
+
+/* Set the default format. */
+#define FORMAT_DEFAULT_SYSV 0
+#define FORMAT_DEFAULT_BSD 1
+#define FORMAT_DEFAULT_AVR 0
+
+#if FORMAT_DEFAULT_SYSV
+ #define FORMAT_DEFAULT format_sysv
+ #define FORMAT_NAME "sysv"
+#elif FORMAT_DEFAULT_BSD
+ #define FORMAT_DEFAULT format_bsd
+ #define FORMAT_NAME "berkeley"
+#elif FORMAT_DEFAULT_AVR
+ #define FORMAT_DEFAULT format_avr
+ #define FORMAT_NAME "avr"
#endif
+
/* Program options. */
static enum
@@ -48,9 +69,8 @@ static enum
}
radix = decimal;
-/* 0 means use AT&T-style output. */
-static int berkeley_format = BSD_DEFAULT;
+format_type_t format = FORMAT_DEFAULT;
static int show_version = 0;
static int show_help = 0;
static int show_totals = 0;
@@ -64,6 +84,246 @@ static bfd_size_type total_textsize;
/* Program exit status. */
static int return_code = 0;
+
+/* AVR Size specific stuff */
+
+#define AVR64 64UL
+#define AVR128 128UL
+#define AVR256 256UL
+#define AVR512 512UL
+#define AVR1K 1024UL
+#define AVR2K 2048UL
+#define AVR4K 4096UL
+#define AVR8K 8192UL
+#define AVR16K 16384UL
+#define AVR20K 20480UL
+#define AVR24K 24576UL
+#define AVR32K 32768UL
+#define AVR36K 36864UL
+#define AVR40K 40960UL
+#define AVR64K 65536UL
+#define AVR68K 69632UL
+#define AVR128K 131072UL
+#define AVR136K 139264UL
+#define AVR200K 204800UL
+#define AVR256K 262144UL
+#define AVR264K 270336UL
+
+typedef struct
+{
+ char *name;
+ long flash;
+ long ram;
+ long eeprom;
+} avr_device_t;
+
+avr_device_t avr[] =
+{
+ {"atxmega256a3", AVR264K, AVR16K, AVR4K},
+ {"atxmega256a3b", AVR264K, AVR16K, AVR4K},
+ {"atxmega256d3", AVR264K, AVR16K, AVR4K},
+
+ {"atmega2560", AVR256K, AVR8K, AVR4K},
+ {"atmega2561", AVR256K, AVR8K, AVR4K},
+
+ {"atxmega192a3", AVR200K, AVR16K, AVR2K},
+ {"atxmega192d3", AVR200K, AVR16K, AVR2K},
+
+ {"atxmega128a1", AVR136K, AVR8K, AVR2K},
+ {"atxmega128a1u", AVR136K, AVR8K, AVR2K},
+ {"atxmega128a3", AVR136K, AVR8K, AVR2K},
+ {"atxmega128d3", AVR136K, AVR8K, AVR2K},
+
+ {"at43usb320", AVR128K, 608UL, 0UL},
+ {"at90can128", AVR128K, AVR4K, AVR4K},
+ {"at90usb1286", AVR128K, AVR8K, AVR4K},
+ {"at90usb1287", AVR128K, AVR8K, AVR4K},
+ {"atmega128", AVR128K, AVR4K, AVR4K},
+ {"atmega1280", AVR128K, AVR8K, AVR4K},
+ {"atmega1281", AVR128K, AVR8K, AVR4K},
+ {"atmega1284p", AVR128K, AVR16K, AVR4K},
+ {"atmega128rfa1", AVR128K, AVR16K, AVR4K},
+ {"atmega103", AVR128K, 4000UL, AVR4K},
+
+ {"atxmega64a1", AVR68K, AVR4K, AVR2K},
+ {"atxmega64a1u", AVR68K, AVR4K, AVR2K},
+ {"atxmega64a3", AVR68K, AVR4K, AVR2K},
+ {"atxmega64d3", AVR68K, AVR4K, AVR2K},
+
+ {"at90can64", AVR64K, AVR4K, AVR2K},
+ {"at90scr100", AVR64K, AVR4K, AVR2K},
+ {"at90usb646", AVR64K, AVR4K, AVR2K},
+ {"at90usb647", AVR64K, AVR4K, AVR2K},
+ {"atmega64", AVR64K, AVR4K, AVR2K},
+ {"atmega640", AVR64K, AVR8K, AVR4K},
+ {"atmega644", AVR64K, AVR4K, AVR2K},
+ {"atmega644a", AVR64K, AVR4K, AVR2K},
+ {"atmega644p", AVR64K, AVR4K, AVR2K},
+ {"atmega644pa", AVR64K, AVR4K, AVR2K},
+ {"atmega645", AVR64K, AVR4K, AVR2K},
+ {"atmega645a", AVR64K, AVR4K, AVR2K},
+ {"atmega645p", AVR64K, AVR4K, AVR2K},
+ {"atmega6450", AVR64K, AVR4K, AVR2K},
+ {"atmega6450a", AVR64K, AVR4K, AVR2K},
+ {"atmega6450p", AVR64K, AVR4K, AVR2K},
+ {"atmega649", AVR64K, AVR4K, AVR2K},
+ {"atmega649a", AVR64K, AVR4K, AVR2K},
+ {"atmega649p", AVR64K, AVR4K, AVR2K},
+ {"atmega6490", AVR64K, AVR4K, AVR2K},
+ {"atmega6490a", AVR64K, AVR4K, AVR2K},
+ {"atmega6490p", AVR64K, AVR4K, AVR2K},
+ {"atmega64c1", AVR64K, AVR4K, AVR2K},
+ {"atmega64hve", AVR64K, AVR4K, AVR1K},
+ {"atmega64m1", AVR64K, AVR4K, AVR2K},
+ {"m3000", AVR64K, AVR4K, 0UL},
+
+ {"atmega406", AVR40K, AVR2K, AVR512},
+
+ {"atxmega32a4", AVR36K, AVR4K, AVR1K},
+ {"atxmega32d4", AVR36K, AVR4K, AVR1K},
+
+ {"at90can32", AVR32K, AVR2K, AVR1K},
+ {"at94k", AVR32K, AVR4K, 0UL},
+ {"atmega32", AVR32K, AVR2K, AVR1K},
+ {"atmega323", AVR32K, AVR2K, AVR1K},
+ {"atmega324a", AVR32K, AVR2K, AVR1K},
+ {"atmega324p", AVR32K, AVR2K, AVR1K},
+ {"atmega324pa", AVR32K, AVR2K, AVR1K},
+ {"atmega325", AVR32K, AVR2K, AVR1K},
+ {"atmega325a", AVR32K, AVR2K, AVR1K},
+ {"atmega325p", AVR32K, AVR2K, AVR1K},
+ {"atmega3250", AVR32K, AVR2K, AVR1K},
+ {"atmega3250a", AVR32K, AVR2K, AVR1K},
+ {"atmega3250p", AVR32K, AVR2K, AVR1K},
+ {"atmega328", AVR32K, AVR2K, AVR1K},
+ {"atmega328p", AVR32K, AVR2K, AVR1K},
+ {"atmega329", AVR32K, AVR2K, AVR1K},
+ {"atmega329a", AVR32K, AVR2K, AVR1K},
+ {"atmega329p", AVR32K, AVR2K, AVR1K},
+ {"atmega329pa", AVR32K, AVR2K, AVR1K},
+ {"atmega3290", AVR32K, AVR2K, AVR1K},
+ {"atmega3290a", AVR32K, AVR2K, AVR1K},
+ {"atmega3290p", AVR32K, AVR2K, AVR1K},
+ {"atmega32hvb", AVR32K, AVR2K, AVR1K},
+ {"atmega32c1", AVR32K, AVR2K, AVR1K},
+ {"atmega32hvb", AVR32K, AVR2K, AVR1K},
+ {"atmega32m1", AVR32K, AVR2K, AVR1K},
+ {"atmega32u2", AVR32K, AVR1K, AVR1K},
+ {"atmega32u4", AVR32K, 2560UL, AVR1K},
+ {"atmega32u6", AVR32K, 2560UL, AVR1K},
+
+ {"at43usb355", AVR24K, 1120UL, 0UL},
+
+ {"atxmega16a4", AVR20K, AVR2K, AVR1K},
+ {"atxmega16d4", AVR20K, AVR2K, AVR1K},
+
+ {"at76c711", AVR16K, AVR2K, 0UL},
+ {"at90pwm216", AVR16K, AVR1K, AVR512},
+ {"at90pwm316", AVR16K, AVR1K, AVR512},
+ {"at90usb162", AVR16K, AVR512, AVR512},
+ {"atmega16", AVR16K, AVR1K, AVR512},
+ {"atmega16a", AVR16K, AVR1K, AVR512},
+ {"atmega161", AVR16K, AVR1K, AVR512},
+ {"atmega162", AVR16K, AVR1K, AVR512},
+ {"atmega163", AVR16K, AVR1K, AVR512},
+ {"atmega164", AVR16K, AVR1K, AVR512},
+ {"atmega164a", AVR16K, AVR1K, AVR512},
+ {"atmega164p", AVR16K, AVR1K, AVR512},
+ {"atmega165a", AVR16K, AVR1K, AVR512},
+ {"atmega165", AVR16K, AVR1K, AVR512},
+ {"atmega165p", AVR16K, AVR1K, AVR512},
+ {"atmega168", AVR16K, AVR1K, AVR512},
+ {"atmega168a", AVR16K, AVR1K, AVR512},
+ {"atmega168p", AVR16K, AVR1K, AVR512},
+ {"atmega169", AVR16K, AVR1K, AVR512},
+ {"atmega169a", AVR16K, AVR1K, AVR512},
+ {"atmega169p", AVR16K, AVR1K, AVR512},
+ {"atmega169pa", AVR16K, AVR1K, AVR512},
+ {"atmega16hva", AVR16K, 768UL, AVR256},
+ {"atmega16hva2", AVR16K, AVR1K, AVR256},
+ {"atmega16hvb", AVR16K, AVR1K, AVR512},
+ {"atmega16m1", AVR16K, AVR1K, AVR512},
+ {"atmega16u2", AVR16K, AVR512, AVR512},
+ {"atmega16u4", AVR16K, 1280UL, AVR512},
+ {"attiny167", AVR16K, AVR512, AVR512},
+
+ {"at90c8534", AVR8K, 352UL, AVR512},
+ {"at90pwm1", AVR8K, AVR512, AVR512},
+ {"at90pwm2", AVR8K, AVR512, AVR512},
+ {"at90pwm2b", AVR8K, AVR512, AVR512},
+ {"at90pwm3", AVR8K, AVR512, AVR512},
+ {"at90pwm3b", AVR8K, AVR512, AVR512},
+ {"at90pwm81", AVR8K, AVR256, AVR512},
+ {"at90s8515", AVR8K, AVR512, AVR512},
+ {"at90s8535", AVR8K, AVR512, AVR512},
+ {"at90usb82", AVR8K, AVR512, AVR512},
+ {"ata6289", AVR8K, AVR512, 320UL},
+ {"atmega8", AVR8K, AVR1K, AVR512},
+ {"atmega8515", AVR8K, AVR512, AVR512},
+ {"atmega8535", AVR8K, AVR512, AVR512},
+ {"atmega88", AVR8K, AVR1K, AVR512},
+ {"atmega88a", AVR8K, AVR1K, AVR512},
+ {"atmega88p", AVR8K, AVR1K, AVR512},
+ {"atmega88pa", AVR8K, AVR1K, AVR512},
+ {"atmega8hva", AVR8K, 768UL, AVR256},
+ {"atmega8u2", AVR8K, AVR512, AVR512},
+ {"attiny84", AVR8K, AVR512, AVR512},
+ {"attiny84a", AVR8K, AVR512, AVR512},
+ {"attiny85", AVR8K, AVR512, AVR512},
+ {"attiny861", AVR8K, AVR512, AVR512},
+ {"attiny861a", AVR8K, AVR512, AVR512},
+ {"attiny87", AVR8K, AVR512, AVR512},
+ {"attiny88", AVR8K, AVR512, AVR64},
+
+ {"at90s4414", AVR4K, 352UL, AVR256},
+ {"at90s4433", AVR4K, AVR128, AVR256},
+ {"at90s4434", AVR4K, 352UL, AVR256},
+ {"atmega48", AVR4K, AVR512, AVR256},
+ {"atmega48a", AVR4K, AVR512, AVR256},
+ {"atmega48p", AVR4K, AVR512, AVR256},
+ {"attiny4313", AVR4K, AVR256, AVR256},
+ {"attiny43u", AVR4K, AVR256, AVR64},
+ {"attiny44", AVR4K, AVR256, AVR256},
+ {"attiny44a", AVR4K, AVR256, AVR256},
+ {"attiny45", AVR4K, AVR256, AVR256},
+ {"attiny461", AVR4K, AVR256, AVR256},
+ {"attiny461a", AVR4K, AVR256, AVR256},
+ {"attiny48", AVR4K, AVR256, AVR64},
+
+ {"at86rf401", AVR2K, 224UL, AVR128},
+ {"at90s2313", AVR2K, AVR128, AVR128},
+ {"at90s2323", AVR2K, AVR128, AVR128},
+ {"at90s2333", AVR2K, 224UL, AVR128},
+ {"at90s2343", AVR2K, AVR128, AVR128},
+ {"attiny20", AVR2K, AVR128, 0UL},
+ {"attiny22", AVR2K, 224UL, AVR128},
+ {"attiny2313", AVR2K, AVR128, AVR128},
+ {"attiny2313a", AVR2K, AVR128, AVR128},
+ {"attiny24", AVR2K, AVR128, AVR128},
+ {"attiny24a", AVR2K, AVR128, AVR128},
+ {"attiny25", AVR2K, AVR128, AVR128},
+ {"attiny26", AVR2K, AVR128, AVR128},
+ {"attiny261", AVR2K, AVR128, AVR128},
+ {"attiny261a", AVR2K, AVR128, AVR128},
+ {"attiny28", AVR2K, 0UL, 0UL},
+ {"attiny40", AVR2K, AVR256, 0UL},
+
+ {"at90s1200", AVR1K, 0UL, AVR64},
+ {"attiny9", AVR1K, 32UL, 0UL},
+ {"attiny10", AVR1K, 32UL, 0UL},
+ {"attiny11", AVR1K, 0UL, AVR64},
+ {"attiny12", AVR1K, 0UL, AVR64},
+ {"attiny13", AVR1K, AVR64, AVR64},
+ {"attiny13a", AVR1K, AVR64, AVR64},
+ {"attiny15", AVR1K, 0UL, AVR64},
+
+ {"attiny4", AVR512, 32UL, 0UL},
+ {"attiny5", AVR512, 32UL, 0UL},
+};
+
+static char *avrmcu = NULL;
+
+
static char *target = NULL;
/* Forward declarations. */
@@ -79,7 +339,8 @@ usage (FILE *stream, int status)
fprintf (stream, _(" Displays the sizes of sections inside binary files\n"));
fprintf (stream, _(" If no input file(s) are specified, a.out is assumed\n"));
fprintf (stream, _(" The options are:\n\
- -A|-B --format={sysv|berkeley} Select output style (default is %s)\n\
+ -A|-B|-C --format={sysv|berkeley|avr} Select output style (default is %s)\n\
+ --mcu=<avrmcu> MCU name for AVR format only\n\
-o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or hex\n\
-t --totals Display the total sizes (Berkeley only)\n\
--common Display total size for *COM* syms\n\
@@ -88,11 +349,7 @@ usage (FILE *stream, int status)
-h --help Display this information\n\
-v --version Display the program's version\n\
\n"),
-#if BSD_DEFAULT
- "berkeley"
-#else
- "sysv"
-#endif
+FORMAT_NAME
);
list_supported_targets (program_name, stream);
if (REPORT_BUGS_TO[0] && status == 0)
@@ -103,6 +360,7 @@ usage (FILE *stream, int status)
#define OPTION_FORMAT (200)
#define OPTION_RADIX (OPTION_FORMAT + 1)
#define OPTION_TARGET (OPTION_RADIX + 1)
+#define OPTION_MCU (OPTION_TARGET + 1)
static struct option long_options[] =
{
@@ -110,6 +368,7 @@ static struct option long_options[] =
{"format", required_argument, 0, OPTION_FORMAT},
{"radix", required_argument, 0, OPTION_RADIX},
{"target", required_argument, 0, OPTION_TARGET},
+ {"mcu", required_argument, 0, 203},
{"totals", no_argument, &show_totals, 1},
{"version", no_argument, &show_version, 1},
{"help", no_argument, &show_help, 1},
@@ -141,7 +400,7 @@ main (int argc, char **argv)
bfd_init ();
set_default_bfd_target ();
- while ((c = getopt_long (argc, argv, "ABHhVvdfotx", long_options,
+ while ((c = getopt_long (argc, argv, "ABCHhVvdfotx", long_options,
(int *) 0)) != EOF)
switch (c)
{
@@ -150,11 +409,15 @@ main (int argc, char **argv)
{
case 'B':
case 'b':
- berkeley_format = 1;
+ format = format_bsd;
break;
case 'S':
case 's':
- berkeley_format = 0;
+ format = format_sysv;
+ break;
+ case 'A':
+ case 'a':
+ format = format_avr;
break;
default:
non_fatal (_("invalid argument to --format: %s"), optarg);
@@ -162,6 +425,10 @@ main (int argc, char **argv)
}
break;
+ case OPTION_MCU:
+ avrmcu = optarg;
+ break;
+
case OPTION_TARGET:
target = optarg;
break;
@@ -190,11 +457,14 @@ main (int argc, char **argv)
break;
case 'A':
- berkeley_format = 0;
+ format = format_sysv;
break;
case 'B':
- berkeley_format = 1;
+ format = format_bsd;
break;
+ case 'C':
+ format = format_avr;
+ break;
case 'v':
case 'V':
show_version = 1;
@@ -240,7 +510,7 @@ main (int argc, char **argv)
for (; optind < argc;)
display_file (argv[optind++]);
- if (show_totals && berkeley_format)
+ if (show_totals && format == format_bsd)
{
bfd_size_type total = total_textsize + total_datasize + total_bsssize;
@@ -599,13 +869,117 @@ print_sysv_format (bfd *file)
printf ("\n\n");
}
+
+static avr_device_t *
+avr_find_device (void)
+{
+ unsigned int i;
+ if (avrmcu != NULL)
+ {
+ for (i = 0; i < sizeof(avr) / sizeof(avr[0]); i++)
+ {
+ if (strcmp(avr[i].name, avrmcu) == 0)
+ {
+ /* Match found */
+ return (&avr[i]);
+ }
+ }
+ }
+ return (NULL);
+}
+
+
+
+static void
+print_avr_format (bfd *file)
+{
+ char *avr_name = "Unknown";
+ int flashmax = 0;
+ int rammax = 0;
+ int eeprommax = 0;
+ asection *section;
+ bfd_size_type my_datasize = 0;
+ bfd_size_type my_textsize = 0;
+ bfd_size_type my_bsssize = 0;
+ bfd_size_type bootloadersize = 0;
+ bfd_size_type noinitsize = 0;
+ bfd_size_type eepromsize = 0;
+
+ avr_device_t *avrdevice = avr_find_device();
+ if (avrdevice != NULL)
+ {
+ avr_name = avrdevice->name;
+ flashmax = avrdevice->flash;
+ rammax = avrdevice->ram;
+ eeprommax = avrdevice->eeprom;
+ }
+
+ if ((section = bfd_get_section_by_name (file, ".data")) != NULL)
+ my_datasize = bfd_section_size (file, section);
+ if ((section = bfd_get_section_by_name (file, ".text")) != NULL)
+ my_textsize = bfd_section_size (file, section);
+ if ((section = bfd_get_section_by_name (file, ".bss")) != NULL)
+ my_bsssize = bfd_section_size (file, section);
+ if ((section = bfd_get_section_by_name (file, ".bootloader")) != NULL)
+ bootloadersize = bfd_section_size (file, section);
+ if ((section = bfd_get_section_by_name (file, ".noinit")) != NULL)
+ noinitsize = bfd_section_size (file, section);
+ if ((section = bfd_get_section_by_name (file, ".eeprom")) != NULL)
+ eepromsize = bfd_section_size (file, section);
+
+ bfd_size_type text = my_textsize + my_datasize + bootloadersize;
+ bfd_size_type data = my_datasize + my_bsssize + noinitsize;
+ bfd_size_type eeprom = eepromsize;
+
+ printf ("AVR Memory Usage\n"
+ "----------------\n"
+ "Device: %s\n\n", avr_name);
+
+ /* Text size */
+ printf ("Program:%8ld bytes", text);
+ if (flashmax > 0)
+ {
+ printf (" (%2.1f%% Full)", ((float)text / flashmax) * 100);
+ }
+ printf ("\n(.text + .data + .bootloader)\n\n");
+
+ /* Data size */
+ printf ("Data: %8ld bytes", data);
+ if (rammax > 0)
+ {
+ printf (" (%2.1f%% Full)", ((float)data / rammax) * 100);
+ }
+ printf ("\n(.data + .bss + .noinit)\n\n");
+
+ /* EEPROM size */
+ if (eeprom > 0)
+ {
+ printf ("EEPROM: %8ld bytes", eeprom);
+ if (eeprommax > 0)
+ {
+ printf (" (%2.1f%% Full)", ((float)eeprom / eeprommax) * 100);
+ }
+ printf ("\n(.eeprom)\n\n");
+ }
+}
+
+
static void
print_sizes (bfd *file)
{
if (show_common)
calculate_common_size (file);
- if (berkeley_format)
- print_berkeley_format (file);
- else
- print_sysv_format (file);
+ switch (format)
+ {
+ case format_sysv:
+ print_sysv_format (file);
+ break;
+ case format_bsd:
+ print_berkeley_format (file);
+ break;
+ case format_avr:
+ default:
+ print_avr_format (file);
+ break;
+ }
}
--
2.4.1

492
patches/gcc/3.4.6/100-uclibc-conf.patch

@ -1,492 +0,0 @@
diff -durN gcc-3.4.6.orig/boehm-gc/configure gcc-3.4.6/boehm-gc/configure
--- gcc-3.4.6.orig/boehm-gc/configure 2006-03-06 04:55:49.000000000 +0100
+++ gcc-3.4.6/boehm-gc/configure 2007-08-15 22:49:47.000000000 +0200
@@ -1947,6 +1947,11 @@
lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
;;