├── .gitignore ├── Readme.md ├── atpack.Dx.build.bash ├── atpack.build.bash ├── atpack.tiny.build.bash ├── automake-patches └── 0001-fix-perl-522.patch ├── avr-gcc-patches ├── 0001-gcc-lto-wrapper.patch ├── atmel-patches-gcc.5.4.0.patch ├── atmel-patches-gcc.5.5.0.patch ├── atmel-patches-gcc.6.5.0-arduino1.patch └── atmel-patches-gcc.7.3.0-arduino2.patch ├── avr-gdb-patches └── 1000-gdb-python-3-7.patch ├── avr-libc-patches ├── 01-arduino-malloc_margin.patch ├── 02-power.patch └── 03-eeprom.patch ├── avr-libc.build.bash ├── binutils-patches └── 00-binutils-data_region_length.patch ├── binutils.build.bash ├── config.guess-am-1.11.4 ├── gcc.build.bash ├── gdb.build.bash ├── package-avr-gcc.bash ├── toolchain-precompiled ├── libiconv-2.dll └── libwinpthread-1.dll └── tools.bash /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | objdir 3 | toolsdir 4 | *-build 5 | autoconf-2.64.tar.bz2 6 | autoconf-2.64/ 7 | automake-1.11.1.tar.bz2 8 | automake-1.11.1/ 9 | avr-binutils.tar.bz2 10 | binutils 11 | avr-gcc.tar.bz2 12 | gcc 13 | avr-gdb.tar.bz2 14 | gdb 15 | avr-libc.tar.bz2 16 | avr-libc/ 17 | avr8-headers.zip 18 | avr8-headers/ 19 | gmp-5.0.2.tar.bz2 20 | mpc-0.9.tar.gz 21 | mpfr-3.0.0.tar.bz2 22 | avr 23 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | ## AVR Toolchain for Arduino 2 | 3 | This is the AVR Toolchain used in the [Arduino IDE](http://arduino.cc/). 4 | 5 | As soon as Atmel [ships a newer toolchain](http://distribute.atmel.no/tools/opensource/Atmel-AVR-GNU-Toolchain/), we pull the source code, **patch it** with some user contributed patches and deliver it with the [Arduino IDE](http://arduino.cc/). 6 | Therefore, the resulting binaries may differ significantly from Atmel's. And you should start blaming us if things are not working as expected :) 7 | 8 | ### Configuring 9 | 10 | Edit the `build.conf` file, currently the only thing worth changing is `AVR_VERSION` on the first line to match whatever the [latest version is](http://distribute.atmel.no/tools/opensource/Atmel-AVR-GNU-Toolchain/). 11 | 12 | At time of writing, the latest toolchain available is based on Atmel 3.6.1 version, but we replaced gcc component with a newer one, porting Atmel patches. It contains: 13 | - binutils-2.26 14 | - gcc-7.3.0 (patches here https://github.com/arduino/toolchain-avr/tree/staging/avr-gcc-patches) 15 | - avr-libc-2.0.0 16 | - gdb-7.8 17 | 18 | ### Building 19 | 20 | Setup has been done on partially set up development machines. If, trying to compile on your machine, you find any package missing from the following list, please open an issue at once! We all can't afford wasting time on setup :) 21 | 22 | To just build, after getting the requirements... 23 | ```bash 24 | ./tools.bash 25 | ./binutils.build.bash 26 | ./gcc.build.bash 27 | ./avr-libc.build.bash 28 | ./gdb.build.bash 29 | ``` 30 | after a successful compile the binaries etc will be found in `objdir` 31 | 32 | To package, after getting the requirements... 33 | ```bash 34 | ./package-avr-gcc.bash 35 | ``` 36 | 37 | #### Debian requirements 38 | 39 | ```bash 40 | sudo apt-get install build-essential gperf bison subversion texinfo zip automake flex libtinfo-dev pkg-config 41 | ``` 42 | 43 | #### Mac OSX requirements. 44 | Either use Homebrew or MacPorts to install dependencies. 45 | ##### MacPorts 46 | You need to install MacPorts: https://www.macports.org/install.php. Once done, open a terminal and type: 47 | 48 | ```bash 49 | sudo port selfupdate 50 | sudo port upgrade outdated 51 | sudo port install wget +universal 52 | sudo port install automake +universal 53 | sudo port install autoconf +universal 54 | sudo port install gpatch +universal 55 | sudo port install gsed +universal 56 | ``` 57 | 58 | ##### Homebrew 59 | You need to install Homebrew: https://www.brew.sh. Once done, open a terminal and type: 60 | 61 | ```bash 62 | brew update 63 | brew upgrade 64 | brew install wget automake autoconf gpatch gnu-sed 65 | ``` 66 | 67 | 68 | #### Windows requirements 69 | 70 | You need to install Cygwin: http://www.cygwin.com/. Once you have run `setup-x86.exe`, use the `Search` text field to filter and select for installation the following packages: 71 | 72 | - git 73 | - wget 74 | - unzip 75 | - zip 76 | - gperf 77 | - bison 78 | - flex 79 | - make 80 | - patch 81 | - automake 82 | - autoconf 83 | - gcc-g++ 84 | - texinfo (must be at version 4.13 since 5+ won't work) 85 | - libncurses-devel 86 | 87 | A note on texinfo: due to dependencies, each time you update/modify your cygwin installation (for example: you install an additional package), texinfo will be upgraded to version 5+, while you need version 4+! 88 | Easy solution: as soon as you've installed the additional package, re-run cygwin setup, search texinfo, triple click on "Keep" until you read version 4, then click next. 89 | 90 | You also need to install MinGW: http://www.mingw.org/. Once you have run mingw-get-setup.exe, select and install (clicking on "Installation" -> "Apply changes") the following packages: 91 | 92 | - mingw-developer-toolkit 93 | - mingw32-base 94 | - mingw32-gcc-g++ 95 | - msys-base 96 | - msys-zip 97 | 98 | ### Upstream credits 99 | 100 | Build process ported from Debian. Most patches come from Atmel. Thank you guys for your awesome work. 101 | 102 | ### Credits 103 | 104 | Consult the [list of contributors](https://github.com/arduino/toolchain-avr/graphs/contributors). 105 | 106 | ### License 107 | 108 | The bash scripts are GPLv2 licensed. Every other software used by these bash scripts has its own license. Consult them to know the terms. 109 | 110 | -------------------------------------------------------------------------------- /atpack.Dx.build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2017 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | source build.conf 19 | 20 | wget ${ATMEL_DX_PACK_URL} 21 | 22 | mkdir -p atpack 23 | cd atpack 24 | rm -rf * 25 | mv ../${ATMEL_DX_PACK_FILENAME}.atpack . 26 | 27 | mv ${ATMEL_DX_PACK_FILENAME}.atpack ${ATMEL_DX_PACK_FILENAME}.zip 28 | unzip ${ATMEL_DX_PACK_FILENAME}.zip 29 | 30 | ALL_FILES=`find ../objdir` 31 | 32 | #copy relevant files to the right folders 33 | # 1- copy includes definitions 34 | EXTRA_INCLUDES=`diff -q ../objdir/avr/include/avr ../atpack/include/avr | grep "Only in" | grep atpack | cut -f4 -d" "` 35 | for x in $EXTRA_INCLUDES; do 36 | cp include/avr/${x} ../objdir/avr/include/avr 37 | done 38 | 39 | # 2 - compact specs into a single folder 40 | SPECS_FOLDERS=`ls gcc/dev` 41 | mkdir temp 42 | for folder in $SPECS_FOLDERS; do 43 | cp -r gcc/dev/${folder}/* temp/ 44 | done 45 | 46 | # 3 - find different files (device-specs) 47 | EXTRA_SPECS=`diff -q ../objdir/lib/gcc/avr/${GCC_VERSION}/device-specs/ temp/device-specs | grep "Only in" | grep temp | cut -f4 -d" "` 48 | for x in $EXTRA_SPECS; do 49 | cp temp/device-specs/${x} ../objdir/lib/gcc/avr/${GCC_VERSION}/device-specs/ 50 | done 51 | 52 | #since https://github.com/gcc-mirror/gcc/commit/21a6b87b86defda10ac903a9cd49e34b1f8ce6fb a lot of devices has specs but avr-libc doesn't support them yet 53 | ALL_DEVICE_SPECS=`ls temp/device-specs` 54 | rm -rf temp/device-specs 55 | 56 | EXTRA_LIBS=`diff -r -q ../objdir/avr/lib temp/ | grep "Only in" | grep temp | cut -f4 -d" "` 57 | for x in $EXTRA_LIBS; do 58 | if [ ! -d temp/${x} ]; then 59 | cd temp 60 | LOCATION=`find . | grep ${x}` 61 | cd .. 62 | else 63 | LOCATION=${x} 64 | fi 65 | cp -r temp/${LOCATION} ../objdir/avr/lib/${LOCATION} 66 | done 67 | 68 | # 4 - extract the correct includes and add them to io.h 69 | # ARGH! difficult! 70 | echo "STARTING THE MAGIC" 71 | for x in $ALL_DEVICE_SPECS; do 72 | DEFINITION=`cat ../objdir/lib/gcc/avr/${GCC_VERSION}/device-specs/${x} | grep __AVR_DEVICE_NAME__ | cut -f 1 -d " " | cut -b 4-` 73 | FANCY_NAME=`cat ../objdir/lib/gcc/avr/${GCC_VERSION}/device-specs/${x} | grep __AVR_DEVICE_NAME__ | cut -f2 -d"="` 74 | echo $DEFINITION 75 | echo $FANCY_NAME 76 | LOWERCASE_DEFINITION="${DEFINITION,,}" 77 | echo $LOWERCASE_DEFINITION 78 | HEADER_TEMP="${LOWERCASE_DEFINITION#__avr_}" 79 | echo $HEADER_TEMP 80 | HEADER="${HEADER_TEMP%__}" 81 | echo $HEADER 82 | _DEFINITION="#elif defined (${DEFINITION})" 83 | echo $__DEFINITION 84 | _HEADER="# include " 85 | echo $__HEADER 86 | if [ "$(grep -c "${DEFINITION}" ../objdir/avr/include/avr/io.h)" == 0 ]; then 87 | NEWFILE=`awk '/iom3000.h/ { print; print "____DEFINITION____"; print "____HEADER____"; next }1' ../objdir/avr/include/avr/io.h | sed "s/____DEFINITION____/$_DEFINITION/g" | sed "s@____HEADER____@$_HEADER@g"` 88 | echo $NEWFILE 89 | echo "$NEWFILE" > ../objdir/avr/include/avr/io.h 90 | fi 91 | done 92 | echo "ENDING THE MAGIC" 93 | #NEW_ALL_FILES=`find ../objdir` 94 | 95 | #echo "NEW FILES ADDED: " 96 | #diff <(echo "$ALL_FILES" ) <(echo "$NEW_ALL_FILES") 97 | 98 | cd .. 99 | 100 | -------------------------------------------------------------------------------- /atpack.build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2017 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | source build.conf 19 | 20 | wget ${ATMEL_ATMEGA_PACK_URL} 21 | 22 | mkdir -p atpack 23 | cd atpack 24 | rm -rf * 25 | mv ../${ATMEL_ATMEGA_PACK_FILENAME}.atpack . 26 | 27 | mv ${ATMEL_ATMEGA_PACK_FILENAME}.atpack ${ATMEL_ATMEGA_PACK_FILENAME}.zip 28 | unzip ${ATMEL_ATMEGA_PACK_FILENAME}.zip 29 | 30 | ALL_FILES=`find ../objdir` 31 | 32 | #copy relevant files to the right folders 33 | # 1- copy includes definitions 34 | EXTRA_INCLUDES=`diff -q ../objdir/avr/include/avr ../atpack/include/avr | grep "Only in" | grep atpack | cut -f4 -d" "` 35 | for x in $EXTRA_INCLUDES; do 36 | cp include/avr/${x} ../objdir/avr/include/avr 37 | done 38 | 39 | # 2 - compact specs into a single folder 40 | SPECS_FOLDERS=`ls gcc/dev` 41 | mkdir temp 42 | for folder in $SPECS_FOLDERS; do 43 | cp -r gcc/dev/${folder}/* temp/ 44 | done 45 | 46 | # 3 - find different files (device-specs) 47 | EXTRA_SPECS=`diff -q ../objdir/lib/gcc/avr/${GCC_VERSION}/device-specs/ temp/device-specs | grep "Only in" | grep temp | cut -f4 -d" "` 48 | for x in $EXTRA_SPECS; do 49 | cp temp/device-specs/${x} ../objdir/lib/gcc/avr/${GCC_VERSION}/device-specs/ 50 | done 51 | 52 | #since https://github.com/gcc-mirror/gcc/commit/21a6b87b86defda10ac903a9cd49e34b1f8ce6fb a lot of devices has specs but avr-libc doesn't support them yet 53 | ALL_DEVICE_SPECS=`ls temp/device-specs` 54 | rm -rf temp/device-specs 55 | 56 | EXTRA_LIBS=`diff -r -q ../objdir/avr/lib temp/ | grep "Only in" | grep temp | cut -f4 -d" "` 57 | for x in $EXTRA_LIBS; do 58 | if [ ! -d temp/${x} ]; then 59 | cd temp 60 | LOCATION=`find . | grep ${x}` 61 | cd .. 62 | else 63 | LOCATION=${x} 64 | fi 65 | cp -r temp/${LOCATION} ../objdir/avr/lib/${LOCATION} 66 | done 67 | 68 | # 4 - extract the correct includes and add them to io.h 69 | # ARGH! difficult! 70 | for x in $ALL_DEVICE_SPECS; do 71 | DEFINITION=`cat ../objdir/lib/gcc/avr/${GCC_VERSION}/device-specs/${x} | grep __AVR_DEVICE_NAME__ | cut -f1 -d" " | cut -f2 -d"D"` 72 | FANCY_NAME=`cat ../objdir/lib/gcc/avr/${GCC_VERSION}/device-specs/${x} | grep __AVR_DEVICE_NAME__ | cut -f2 -d"="` 73 | LOWERCASE_DEFINITION="${DEFINITION,,}" 74 | HEADER_TEMP="${LOWERCASE_DEFINITION#__avr_atmega}" 75 | HEADER="${HEADER_TEMP%__}" 76 | _DEFINITION="#elif defined (${DEFINITION})" 77 | _HEADER="# include " 78 | if [ "$(grep -c "${DEFINITION}" ../objdir/avr/include/avr/io.h)" == 0 ]; then 79 | NEWFILE=`awk '/iom3000.h/ { print; print "____DEFINITION____"; print "____HEADER____"; next }1' ../objdir/avr/include/avr/io.h | sed "s/____DEFINITION____/$_DEFINITION/g" | sed "s@____HEADER____@$_HEADER@g"` 80 | echo "$NEWFILE" > ../objdir/avr/include/avr/io.h 81 | fi 82 | done 83 | 84 | #NEW_ALL_FILES=`find ../objdir` 85 | 86 | #echo "NEW FILES ADDED: " 87 | #diff <(echo "$ALL_FILES" ) <(echo "$NEW_ALL_FILES") 88 | 89 | cd .. 90 | 91 | -------------------------------------------------------------------------------- /atpack.tiny.build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2017 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | source build.conf 19 | 20 | wget ${ATMEL_ATTINY_PACK_URL} 21 | 22 | mkdir -p atpack 23 | cd atpack 24 | rm -rf * 25 | mv ../${ATMEL_ATTINY_PACK_FILENAME}.atpack . 26 | 27 | mv ${ATMEL_ATTINY_PACK_FILENAME}.atpack ${ATMEL_ATTINY_PACK_FILENAME}.zip 28 | unzip ${ATMEL_ATTINY_PACK_FILENAME}.zip 29 | 30 | ALL_FILES=`find ../objdir` 31 | 32 | #copy relevant files to the right folders 33 | # 1- copy includes definitions 34 | EXTRA_INCLUDES=`diff -q ../objdir/avr/include/avr ../atpack/include/avr | grep "Only in" | grep atpack | cut -f4 -d" "` 35 | for x in $EXTRA_INCLUDES; do 36 | cp include/avr/${x} ../objdir/avr/include/avr 37 | done 38 | 39 | # 2 - compact specs into a single folder 40 | SPECS_FOLDERS=`ls gcc/dev` 41 | mkdir temp 42 | for folder in $SPECS_FOLDERS; do 43 | cp -r gcc/dev/${folder}/* temp/ 44 | done 45 | 46 | # 3 - find different files (device-specs) 47 | EXTRA_SPECS=`diff -q ../objdir/lib/gcc/avr/${GCC_VERSION}/device-specs/ temp/device-specs | grep "Only in" | grep temp | cut -f4 -d" "` 48 | for x in $EXTRA_SPECS; do 49 | cp temp/device-specs/${x} ../objdir/lib/gcc/avr/${GCC_VERSION}/device-specs/ 50 | done 51 | 52 | #since https://github.com/gcc-mirror/gcc/commit/21a6b87b86defda10ac903a9cd49e34b1f8ce6fb a lot of devices has specs but avr-libc doesn't support them yet 53 | ALL_DEVICE_SPECS=`ls temp/device-specs` 54 | rm -rf temp/device-specs 55 | 56 | EXTRA_LIBS=`diff -r -q ../objdir/avr/lib temp/ | grep "Only in" | grep temp | cut -f4 -d" "` 57 | for x in $EXTRA_LIBS; do 58 | if [ ! -d temp/${x} ]; then 59 | cd temp 60 | LOCATION=`find . | grep ${x}` 61 | cd .. 62 | else 63 | LOCATION=${x} 64 | fi 65 | cp -r temp/${LOCATION} ../objdir/avr/lib/${LOCATION} 66 | done 67 | 68 | # 4 - extract the correct includes and add them to io.h 69 | # ARGH! difficult! 70 | for x in $ALL_DEVICE_SPECS; do 71 | DEFINITION=`cat ../objdir/lib/gcc/avr/${GCC_VERSION}/device-specs/${x} | grep __AVR_DEVICE_NAME__ | cut -f1 -d" " | cut -f2 -d"D"` 72 | FANCY_NAME=`cat ../objdir/lib/gcc/avr/${GCC_VERSION}/device-specs/${x} | grep __AVR_DEVICE_NAME__ | cut -f2 -d"="` 73 | LOWERCASE_DEFINITION="${DEFINITION,,}" 74 | HEADER_TEMP="${LOWERCASE_DEFINITION#__avr_attiny}" 75 | HEADER="${HEADER_TEMP%__}" 76 | _DEFINITION="#elif defined (${DEFINITION})" 77 | _HEADER="# include " 78 | if [ "$(grep -c "${DEFINITION}" ../objdir/avr/include/avr/io.h)" == 0 ]; then 79 | NEWFILE=`awk '/iom3000.h/ { print; print "____DEFINITION____"; print "____HEADER____"; next }1' ../objdir/avr/include/avr/io.h | sed "s/____DEFINITION____/$_DEFINITION/g" | sed "s@____HEADER____@$_HEADER@g"` 80 | echo "$NEWFILE" > ../objdir/avr/include/avr/io.h 81 | fi 82 | done 83 | 84 | #NEW_ALL_FILES=`find ../objdir` 85 | 86 | #echo "NEW FILES ADDED: " 87 | #diff <(echo "$ALL_FILES" ) <(echo "$NEW_ALL_FILES") 88 | 89 | cd .. 90 | 91 | -------------------------------------------------------------------------------- /automake-patches/0001-fix-perl-522.patch: -------------------------------------------------------------------------------- 1 | --- /automake.in 2017-12-18 12:26:59.455263520 +0100 2 | +++ /automake.in 2017-12-18 12:27:21.228596603 +0100 3 | @@ -4110,7 +4110,7 @@ 4 | sub substitute_ac_subst_variables ($) 5 | { 6 | my ($text) = @_; 7 | - $text =~ s/\${([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge; 8 | + $text =~ s/\$[{]([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge; 9 | return $text; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /avr-gcc-patches/0001-gcc-lto-wrapper.patch: -------------------------------------------------------------------------------- 1 | --- gcc/lto-wrapper.c 2016-08-22 11:19:17.000000000 +0200 2 | +++ gcc/lto-wrapper.c 2017-12-18 12:48:25.685248735 +0100 3 | @@ -594,7 +594,7 @@ 4 | filename[p - argv[i]] = '\0'; 5 | file_offset = (off_t) loffset; 6 | } 7 | - fd = open (argv[i], O_RDONLY); 8 | + fd = open (argv[i], O_RDONLY|O_BINARY); 9 | if (fd == -1) 10 | continue; 11 | sobj = simple_object_start_read (fd, file_offset, "__GNU_LTO", 12 | -------------------------------------------------------------------------------- /avr-gcc-patches/atmel-patches-gcc.7.3.0-arduino2.patch: -------------------------------------------------------------------------------- 1 | diff -ur gcc/gcc/config/avr/avr-arch.h gcc-7.3.0-patched/gcc/config/avr/avr-arch.h 2 | --- gcc/gcc/config/avr/avr-arch.h 2017-04-04 00:30:56.274463000 +0200 3 | +++ gcc-7.3.0-patched/gcc/config/avr/avr-arch.h 2018-11-29 16:17:03.362317759 +0100 4 | @@ -41,6 +41,7 @@ 5 | ARCH_AVR6, 6 | ARCH_AVRTINY, 7 | ARCH_AVRXMEGA2, 8 | + ARCH_AVRXMEGA3, 9 | ARCH_AVRXMEGA4, 10 | ARCH_AVRXMEGA5, 11 | ARCH_AVRXMEGA6, 12 | @@ -86,6 +87,9 @@ 13 | /* Default start of data section address for architecture. */ 14 | int default_data_section_start; 15 | 16 | + /* Offset where flash memory is seen in RAM address range or 0. */ 17 | + int flash_pm_offset; 18 | + 19 | /* Offset between SFR address and RAM address: 20 | SFR-address = RAM-address - sfr_offset */ 21 | int sfr_offset; 22 | @@ -120,6 +124,9 @@ 23 | /* Start of text section. */ 24 | int text_section_start; 25 | 26 | + /* Non bit addressable registers mask. */ 27 | + unsigned int non_bit_addressable_registers_mask; 28 | + 29 | /* Flash size in bytes. */ 30 | int flash_size; 31 | } avr_mcu_t; 32 | @@ -150,7 +157,16 @@ 33 | 34 | For information please refer the following respective errata links 35 | http://www.atmel.com/dyn/resources/prod_documents/doc2494.pdf 36 | - http://www.atmel.com/dyn/resources/prod_documents/doc1436.pdf */ 37 | + http://www.atmel.com/dyn/resources/prod_documents/doc1436.pdf 38 | + 39 | +AVR_ISA_RCALL 40 | + Always use RJMP / RCALL and assume JMP / CALL are not available. 41 | + This affects multilib selection via specs generation and -mshort-calls. 42 | + Even if a device like ATtiny417 from avrxmega3 supports JMP / CALL, we 43 | + assume these instructions are not available and we set the built-in 44 | + macro __AVR_HAVE_JMP_CALL__ accordingly. This macro is used to 45 | + determine a rough estimate of flash size in libgcc, and AVR-LibC uses 46 | + this macro to determine vector sizes. */ 47 | 48 | enum avr_device_specific_features 49 | { 50 | @@ -158,8 +174,10 @@ 51 | AVR_ISA_RMW = 0x1, /* device has RMW instructions. */ 52 | AVR_SHORT_SP = 0x2, /* Stack Pointer has 8 bits width. */ 53 | AVR_ERRATA_SKIP = 0x4, /* device has a core erratum. */ 54 | - AVR_ISA_LDS = 0x8 /* whether LDS / STS is valid for all data in static 55 | + AVR_ISA_LDS = 0x8, /* whether LDS / STS is valid for all data in static 56 | storage. Only useful for reduced Tiny. */ 57 | + AVR_ISA_RCALL = 0x10 /* Use RJMP / RCALL even though JMP / CALL 58 | + are available (-mshort-calls). */ 59 | }; 60 | 61 | /* Map architecture to its texinfo string. */ 62 | Only in gcc-7.3.0-patched/gcc/config/avr: avr-arch.h.orig 63 | Only in gcc-7.3.0-patched/gcc/config/avr: avr-arch.h.rej 64 | diff -ur gcc/gcc/config/avr/avr.c gcc-7.3.0-patched/gcc/config/avr/avr.c 65 | --- gcc/gcc/config/avr/avr.c 2017-08-22 09:55:34.767308000 +0200 66 | +++ gcc-7.3.0-patched/gcc/config/avr/avr.c 2018-12-03 11:05:34.994764831 +0100 67 | @@ -51,6 +51,8 @@ 68 | #include "builtins.h" 69 | #include "context.h" 70 | #include "tree-pass.h" 71 | +#include "vec.h" 72 | +#include "opts.h" 73 | #include "print-rtl.h" 74 | #include "rtl-iter.h" 75 | 76 | @@ -94,6 +96,14 @@ 77 | #define AVR_SYMBOL_FLAG_TINY_ABSDATA \ 78 | (SYMBOL_FLAG_MACH_DEP << 8) 79 | 80 | +/* (AVR_TINY only): Symbol has attribute progmem */ 81 | +#define AVR_SYMBOL_FLAG_TINY_PM \ 82 | + (SYMBOL_FLAG_MACH_DEP << 7) 83 | + 84 | +/* (AVR_TINY only): Symbol has attribute absdata */ 85 | +#define AVR_SYMBOL_FLAG_TINY_ABSDATA \ 86 | + (SYMBOL_FLAG_MACH_DEP << 8) 87 | + 88 | #define TINY_ADIW(REG1, REG2, I) \ 89 | "subi " #REG1 ",lo8(-(" #I "))" CR_TAB \ 90 | "sbci " #REG2 ",hi8(-(" #I "))" 91 | @@ -119,6 +129,8 @@ 92 | { ADDR_SPACE_MEMX, 1, 3, "__memx", 0, ".progmemx.data" }, 93 | }; 94 | 95 | +unsigned long avr_non_bit_addressable_registers_mask; 96 | + 97 | 98 | /* Holding RAM addresses of some SFRs used by the compiler and that 99 | are unique over all devices in an architecture like 'avr4'. */ 100 | @@ -720,6 +732,58 @@ 101 | return false; 102 | } 103 | 104 | +/* Same as opts-common.c:integral_argument, but uses strtoul instead 105 | + of atoi/strtol. */ 106 | + 107 | +static unsigned long 108 | +parse_unsigned_long (const char *arg) 109 | +{ 110 | + const char *p = arg; 111 | + 112 | + while (*p && ISDIGIT (*p)) 113 | + p++; 114 | + 115 | + if (*p == '\0') 116 | + return strtoul(arg, NULL, 10); 117 | + 118 | + /* It wasn't a decimal number - try hexadecimal. */ 119 | + if (arg[0] == '0' && (arg[1] == 'x' || arg[1] == 'X')) 120 | + { 121 | + p = arg + 2; 122 | + while (*p && ISXDIGIT (*p)) 123 | + p++; 124 | + 125 | + if (p != arg + 2 && *p == '\0') 126 | + return strtoul(arg, NULL, 16); 127 | + } 128 | + 129 | + warning (OPT_mnon_bit_addressable_registers_mask_, 130 | + "argument is not a number, ignored"); 131 | + return 0; 132 | +} 133 | + 134 | +static void 135 | +avr_handle_deferred_options(void) { 136 | + 137 | + unsigned int i; 138 | + cl_deferred_option *opt; 139 | + vec *v 140 | + = (vec *) avr_deferred_options; 141 | + 142 | + if (v) 143 | + FOR_EACH_VEC_ELT (*v, i, opt) 144 | + { 145 | + switch (opt->opt_index) 146 | + { 147 | + case OPT_mnon_bit_addressable_registers_mask_: 148 | + avr_non_bit_addressable_registers_mask = parse_unsigned_long (opt->arg); 149 | + break; 150 | + 151 | + default: 152 | + gcc_unreachable (); 153 | + } 154 | + } 155 | +} 156 | 157 | /* Implement `TARGET_OPTION_OVERRIDE'. */ 158 | 159 | @@ -796,7 +860,12 @@ 160 | 161 | init_machine_status = avr_init_machine_status; 162 | 163 | + if (!global_options_set.x_dwarf_version) 164 | + dwarf_version = 2; 165 | + 166 | avr_log_set_avr_log(); 167 | + 168 | + avr_handle_deferred_options(); 169 | } 170 | 171 | /* Function to set up the backend function structure. */ 172 | @@ -981,6 +1050,15 @@ 173 | return avr_lookup_function_attribute1 (func, "interrupt"); 174 | } 175 | 176 | +/* Return nonzero if FUNC is an nmi function as specified 177 | + by the "nmi" attribute. */ 178 | + 179 | +static int 180 | +avr_nmi_function_p (tree func) 181 | +{ 182 | + return avr_lookup_function_attribute1 (func, "nmi"); 183 | +} 184 | + 185 | /* Return nonzero if FUNC is a signal function as specified 186 | by the "signal" attribute. */ 187 | 188 | @@ -1028,15 +1106,22 @@ 189 | cfun->machine->is_naked = avr_naked_function_p (decl); 190 | cfun->machine->is_signal = avr_signal_function_p (decl); 191 | cfun->machine->is_interrupt = avr_interrupt_function_p (decl); 192 | + cfun->machine->is_nmi = avr_nmi_function_p (decl); 193 | cfun->machine->is_OS_task = avr_OS_task_function_p (decl); 194 | cfun->machine->is_OS_main = avr_OS_main_function_p (decl); 195 | 196 | - isr = cfun->machine->is_interrupt ? "interrupt" : "signal"; 197 | + if (cfun->machine->is_interrupt) 198 | + isr = "interrupt"; 199 | + else if (cfun->machine->is_nmi) 200 | + isr = "nmi"; 201 | + else 202 | + isr = "signal"; 203 | 204 | /* Too much attributes make no sense as they request conflicting features. */ 205 | 206 | if (cfun->machine->is_OS_task + cfun->machine->is_OS_main 207 | - + (cfun->machine->is_signal || cfun->machine->is_interrupt) > 1) 208 | + + (cfun->machine->is_signal || cfun->machine->is_interrupt 209 | + || cfun->machine->is_nmi) > 1) 210 | error_at (loc, "function attributes %qs, %qs and %qs are mutually" 211 | " exclusive", "OS_task", "OS_main", isr); 212 | 213 | @@ -1047,7 +1132,8 @@ 214 | warning_at (loc, OPT_Wattributes, "function attributes %qs and %qs have" 215 | " no effect on %qs function", "OS_task", "OS_main", "naked"); 216 | 217 | - if (cfun->machine->is_interrupt || cfun->machine->is_signal) 218 | + if (cfun->machine->is_interrupt || cfun->machine->is_signal 219 | + || cfun->machine->is_nmi) 220 | { 221 | tree args = TYPE_ARG_TYPES (TREE_TYPE (decl)); 222 | tree ret = TREE_TYPE (TREE_TYPE (decl)); 223 | @@ -2154,7 +2240,7 @@ 224 | if (CONST == GET_CODE (x)) 225 | x = XEXP (XEXP (x, 0), 0); 226 | 227 | - if (SYMBOL_REF_P (x)) 228 | + if (SYMBOL_REF == GET_CODE (x)) 229 | return SYMBOL_REF_FLAGS (x) & AVR_SYMBOL_FLAG_TINY_ABSDATA; 230 | 231 | if (CONST_INT_P (x) 232 | @@ -2518,7 +2604,7 @@ 233 | if (AVR_TINY 234 | && avr_address_tiny_pm_p (addr)) 235 | { 236 | - addr = plus_constant (Pmode, addr, AVR_TINY_PM_OFFSET); 237 | + addr = plus_constant (Pmode, addr, avr_arch->flash_pm_offset); 238 | } 239 | 240 | switch (GET_CODE (addr)) 241 | @@ -2660,8 +2746,8 @@ 242 | 243 | if ('i' != code) 244 | fprintf (file, HOST_WIDE_INT_PRINT_DEC, ival + abcd); 245 | - else if (low_io_address_operand (x, VOIDmode) 246 | - || high_io_address_operand (x, VOIDmode)) 247 | + /* else if Low or High IO address operand */ 248 | + else if (io_address_operand (x, VOIDmode)) 249 | { 250 | if (AVR_HAVE_RAMPZ && ival == avr_addr.rampz) 251 | fprintf (file, "__RAMPZ__"); 252 | @@ -3680,6 +3766,48 @@ 253 | return ""; 254 | } 255 | 256 | +/* 257 | +The range check is needed only if the device has SRAM greater than 258 | +LDS/STS range. Only attiny40 has that much SRAM and needs special 259 | +consideration. Also include avrtiny, as code compiled for avrtiny is 260 | +supposed to work for all devices in the arch. 261 | +*/ 262 | +static bool tiny_device_has_out_of_range_sram () 263 | +{ 264 | + return AVR_TINY && 265 | + (strcmp (avr_mmcu, "attiny40") == 0 266 | + || strcmp (avr_mmcu, "avrtiny") == 0); 267 | +} 268 | + 269 | +/* 270 | +AVRTC-579 271 | +if operand is symbol or constant expression with value > 0xbf 272 | + return false, otherwise true 273 | +This check is used to avoid lds/sts instruction with invalid memory 274 | +access range (valid range 0x40..0xbf). For io operand range 0x0..0x3f, 275 | +in/out instruction will be generated. 276 | +*/ 277 | +bool tiny_valid_direct_memory_access_range(rtx op, enum machine_mode mode) 278 | +{ 279 | + rtx x; 280 | + 281 | + if (!AVR_TINY) 282 | + return true; 283 | + 284 | + x = XEXP(op,0); 285 | + 286 | + if (MEM_P(op) && x && (GET_CODE(x) == SYMBOL_REF)) 287 | + { 288 | + return !tiny_device_has_out_of_range_sram (); 289 | + } 290 | + if (MEM_P(op) && x && (CONSTANT_ADDRESS_P (x)) && 291 | + !(IN_RANGE (INTVAL (x), 0, 0xC0 - GET_MODE_SIZE (mode)))) 292 | + { 293 | + return false; 294 | + } 295 | + 296 | + return true; 297 | +} 298 | 299 | const char* 300 | output_movqi (rtx_insn *insn, rtx operands[], int *plen) 301 | @@ -9413,7 +9541,7 @@ 302 | if (AVR_TINY 303 | && avr_address_tiny_pm_p (x)) 304 | { 305 | - x = plus_constant (Pmode, x, AVR_TINY_PM_OFFSET); 306 | + x = plus_constant (Pmode, x, avr_arch->flash_pm_offset); 307 | } 308 | 309 | return default_assemble_integer (x, size, aligned_p); 310 | @@ -9575,7 +9703,7 @@ 311 | (GEN_INT (TREE_INT_CST_LOW (arg)), QImode))) 312 | { 313 | warning_at (loc, OPT_Wattributes, "%qE attribute address " 314 | - "out of range", name); 315 | + "out of range or not bit addressable", name); 316 | *no_add = true; 317 | } 318 | else 319 | @@ -9641,6 +9769,8 @@ 320 | false }, 321 | { "interrupt", 0, 0, true, false, false, avr_handle_fndecl_attribute, 322 | false }, 323 | + { "nmi", 0, 0, true, false, false, avr_handle_fndecl_attribute, 324 | + false }, 325 | { "naked", 0, 0, false, true, true, avr_handle_fntype_attribute, 326 | false }, 327 | { "OS_task", 0, 0, false, true, true, avr_handle_fntype_attribute, 328 | @@ -10017,9 +10147,11 @@ 329 | avr_asm_init_sections (void) 330 | { 331 | /* Override section callbacks to keep track of `avr_need_clear_bss_p' 332 | - resp. `avr_need_copy_data_p'. */ 333 | + resp. `avr_need_copy_data_p'. If flash is not mapped to RAM then 334 | + we have also to track .rodata because it is located in RAM then. */ 335 | 336 | - readonly_data_section->unnamed.callback = avr_output_data_section_asm_op; 337 | + if (0 == avr_arch->flash_pm_offset) 338 | + readonly_data_section->unnamed.callback = avr_output_data_section_asm_op; 339 | data_section->unnamed.callback = avr_output_data_section_asm_op; 340 | bss_section->unnamed.callback = avr_output_bss_section_asm_op; 341 | } 342 | @@ -10051,9 +10183,13 @@ 343 | 344 | if (!avr_need_copy_data_p) 345 | avr_need_copy_data_p = (STR_PREFIX_P (name, ".data") 346 | - || STR_PREFIX_P (name, ".rodata") 347 | || STR_PREFIX_P (name, ".gnu.linkonce.d")); 348 | 349 | + if (!avr_need_copy_data_p 350 | + && 0 == avr_arch->flash_pm_offset) 351 | + avr_need_copy_data_p = (STR_PREFIX_P (name, ".rodata") 352 | + || STR_PREFIX_P (name, ".gnu.linkonce.r")); 353 | + 354 | if (!avr_need_clear_bss_p) 355 | avr_need_clear_bss_p = STR_PREFIX_P (name, ".bss"); 356 | 357 | @@ -10221,14 +10357,14 @@ 358 | && decl 359 | && VAR_DECL == TREE_CODE (decl) 360 | && MEM_P (rtl) 361 | - && SYMBOL_REF_P (XEXP (rtl, 0))) 362 | + && SYMBOL_REF == GET_CODE (XEXP (rtl, 0))) 363 | { 364 | rtx sym = XEXP (rtl, 0); 365 | bool progmem_p = -1 == avr_progmem_p (decl, DECL_ATTRIBUTES (decl)); 366 | 367 | if (progmem_p) 368 | { 369 | - // Tag symbols for later addition of 0x4000 (AVR_TINY_PM_OFFSET). 370 | + // Tag symbols for addition of 0x4000 (avr_arch->flash_pm_offset). 371 | SYMBOL_REF_FLAGS (sym) |= AVR_SYMBOL_FLAG_TINY_PM; 372 | } 373 | 374 | @@ -10546,7 +10682,11 @@ 375 | return true; 376 | 377 | case MEM: 378 | - *total = COSTS_N_INSNS (GET_MODE_SIZE (mode)); 379 | + /* MEM rtx with non-default address space is more 380 | + expensive. Not expressing that results in reg 381 | + clobber during expand (PR 65657). */ 382 | + *total = COSTS_N_INSNS (GET_MODE_SIZE (mode) 383 | + + (MEM_ADDR_SPACE(x) == ADDR_SPACE_RAM ? 0 : 5)); 384 | return true; 385 | 386 | case NEG: 387 | @@ -14452,6 +14592,10 @@ 388 | 389 | #undef TARGET_USE_BY_PIECES_INFRASTRUCTURE_P 390 | #define TARGET_USE_BY_PIECES_INFRASTRUCTURE_P \ 391 | + avr_use_by_pieces_infrastructure_p 392 | + 393 | +#undef TARGET_USE_BY_PIECES_INFRASTRUCTURE_P 394 | +#define TARGET_USE_BY_PIECES_INFRASTRUCTURE_P \ 395 | avr_use_by_pieces_infrastructure_p 396 | 397 | #undef TARGET_LEGITIMATE_COMBINED_INSN 398 | diff -ur gcc/gcc/config/avr/avr-c.c gcc-7.3.0-patched/gcc/config/avr/avr-c.c 399 | --- gcc/gcc/config/avr/avr-c.c 2017-01-01 13:07:43.905435000 +0100 400 | +++ gcc-7.3.0-patched/gcc/config/avr/avr-c.c 2018-11-29 15:57:13.998975425 +0100 401 | @@ -313,11 +313,16 @@ 402 | cpp_define (pfile, "__AVR_ENHANCED__"); 403 | cpp_define (pfile, "__AVR_HAVE_MUL__"); 404 | } 405 | + 406 | + if (AVR_HAVE_JMP_CALL) 407 | + cpp_define (pfile, "__AVR_HAVE_JMP_CALL__"); 408 | + 409 | if (avr_arch->have_jmp_call) 410 | - { 411 | - cpp_define (pfile, "__AVR_MEGA__"); 412 | - cpp_define (pfile, "__AVR_HAVE_JMP_CALL__"); 413 | - } 414 | + cpp_define (pfile, "__AVR_MEGA__"); 415 | + 416 | + if (AVR_SHORT_CALLS) 417 | + cpp_define (pfile, "__AVR_SHORT_CALLS__"); 418 | + 419 | if (AVR_XMEGA) 420 | cpp_define (pfile, "__AVR_XMEGA__"); 421 | 422 | @@ -335,9 +340,13 @@ 423 | (ATtiny4/5/9/10/20 and 40) mapped program memory starts at 0x4000. */ 424 | 425 | cpp_define_formatted (pfile, "__AVR_TINY_PM_BASE_ADDRESS__=0x%x", 426 | - AVR_TINY_PM_OFFSET); 427 | + avr_arch->flash_pm_offset); 428 | } 429 | 430 | + if (avr_arch->flash_pm_offset) 431 | + cpp_define_formatted (pfile, "__AVR_PM_BASE_ADDRESS__=0x%x", 432 | + avr_arch->flash_pm_offset); 433 | + 434 | if (AVR_HAVE_EIJMP_EICALL) 435 | { 436 | cpp_define (pfile, "__AVR_HAVE_EIJMP_EICALL__"); 437 | Only in gcc-7.3.0-patched/gcc/config/avr: avr-c.c.rej 438 | Only in gcc-7.3.0-patched/gcc/config/avr: avr.c.orig 439 | Only in gcc-7.3.0-patched/gcc/config/avr: avr.c.rej 440 | diff -ur gcc/gcc/config/avr/avr-devices.c gcc-7.3.0-patched/gcc/config/avr/avr-devices.c 441 | --- gcc/gcc/config/avr/avr-devices.c 2017-01-01 13:07:43.905435000 +0100 442 | +++ gcc-7.3.0-patched/gcc/config/avr/avr-devices.c 2018-11-29 15:59:05.605642936 +0100 443 | @@ -34,30 +34,31 @@ 444 | avr_arch_types[] = 445 | { 446 | /* unknown device specified */ 447 | - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, NULL, AVR_MMCU_DEFAULT }, 448 | + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, NULL, AVR_MMCU_DEFAULT }, 449 | /* 450 | - A M J LM E E E X R T d S S O A 451 | - S U M PO L L I M A I a t F ff r 452 | - M L P MV P P J E M N t a R s c 453 | - XW M M M G P Y a r e h 454 | - X P A D t t ID */ 455 | - { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, "1", "avr1" }, 456 | - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, "2", "avr2" }, 457 | - { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, 32, "25", "avr25" }, 458 | - { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, "3", "avr3" }, 459 | - { 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0x0060, 32, "31", "avr31" }, 460 | - { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0x0060, 32, "35", "avr35" }, 461 | - { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, 32, "4", "avr4" }, 462 | - { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0x0060, 32, "5", "avr5" }, 463 | - { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0x0060, 32, "51", "avr51" }, 464 | - { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0x0060, 32, "6", "avr6" }, 465 | + A M J LM E E E X R T d S FPO S O A 466 | + S U M PO L L I M A I a t lMff F ff r 467 | + M L P MV P P J E M N t a a s R s c 468 | + XW M M M G P Y a r s e e h 469 | + X P A D t h t t ID */ 470 | + { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "1", "avr1" }, 471 | + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "2", "avr2" }, 472 | + { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "25", "avr25" }, 473 | + { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "3", "avr3" }, 474 | + { 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0x0060, 0, 32, "31", "avr31" }, 475 | + { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "35", "avr35" }, 476 | + { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "4", "avr4" }, 477 | + { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "5", "avr5" }, 478 | + { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0x0060, 0, 32, "51", "avr51" }, 479 | + { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0x0060, 0, 32, "6", "avr6" }, 480 | 481 | - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0x0040, 0, "100", "avrtiny" }, 482 | - { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0x2000, 0, "102", "avrxmega2" }, 483 | - { 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0x2000, 0, "104", "avrxmega4" }, 484 | - { 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0x2000, 0, "105", "avrxmega5" }, 485 | - { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0x2000, 0, "106", "avrxmega6" }, 486 | - { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0x2000, 0, "107", "avrxmega7" } 487 | + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0x0040, 0x4000, 0, "100", "avrtiny" }, 488 | + { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0x2000, 0, 0, "102", "avrxmega2" }, 489 | + { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0x2000, 0x8000, 0, "103", "avrxmega3" }, 490 | + { 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0x2000, 0, 0, "104", "avrxmega4" }, 491 | + { 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0x2000, 0, 0, "105", "avrxmega5" }, 492 | + { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0x2000, 0, 0, "106", "avrxmega6" }, 493 | + { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0x2000, 0, 0, "107", "avrxmega7" } 494 | }; 495 | 496 | const avr_arch_info_t 497 | @@ -95,6 +96,9 @@ 498 | { ARCH_AVRXMEGA2, 499 | "``XMEGA'' devices with more than 8@tie{}KiB and up to 64@tie{}KiB " 500 | "of program memory." }, 501 | + { ARCH_AVRXMEGA3, 502 | + "``XMEGA'' devices with up to 64@tie{}KiB of combined program memory " 503 | + "and RAM, and with program memory visible in the RAM address space." }, 504 | { ARCH_AVRXMEGA4, 505 | "``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB " 506 | "of program memory." }, 507 | @@ -111,12 +115,12 @@ 508 | const avr_mcu_t 509 | avr_mcu_types[] = 510 | { 511 | -#define AVR_MCU(NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, FLASH_SIZE)\ 512 | - { NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, FLASH_SIZE }, 513 | +#define AVR_MCU(NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, NON_BIT_ADDRESSABLE_REG_MASK, FLASH_SIZE)\ 514 | + { NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, NON_BIT_ADDRESSABLE_REG_MASK, FLASH_SIZE }, 515 | #include "avr-mcus.def" 516 | #undef AVR_MCU 517 | /* End of list. */ 518 | - { NULL, ARCH_UNKNOWN, AVR_ISA_NONE, NULL, 0, 0, 0 } 519 | + { NULL, ARCH_UNKNOWN, AVR_ISA_NONE, NULL, 0, 0, 0, 0 } 520 | }; 521 | 522 | 523 | Only in gcc-7.3.0-patched/gcc/config/avr: avr-devices.c.orig 524 | Only in gcc-7.3.0-patched/gcc/config/avr: avr-devices.c.rej 525 | diff -ur gcc/gcc/config/avr/avr.h gcc-7.3.0-patched/gcc/config/avr/avr.h 526 | --- gcc/gcc/config/avr/avr.h 2017-01-16 10:48:45.991005000 +0100 527 | +++ gcc-7.3.0-patched/gcc/config/avr/avr.h 2018-11-29 15:40:15.268967655 +0100 528 | @@ -60,7 +60,9 @@ 529 | 530 | #define TARGET_CPU_CPP_BUILTINS() avr_cpu_cpp_builtins (pfile) 531 | 532 | -#define AVR_HAVE_JMP_CALL (avr_arch->have_jmp_call) 533 | +#define AVR_SHORT_CALLS (TARGET_SHORT_CALLS \ 534 | + && avr_arch == &avr_arch_types[ARCH_AVRXMEGA3]) 535 | +#define AVR_HAVE_JMP_CALL (avr_arch->have_jmp_call && ! AVR_SHORT_CALLS) 536 | #define AVR_HAVE_MUL (avr_arch->have_mul) 537 | #define AVR_HAVE_MOVW (avr_arch->have_movw_lpmx) 538 | #define AVR_HAVE_LPM (!AVR_TINY) 539 | @@ -149,6 +151,8 @@ 540 | #define SIZE_TYPE (INT_TYPE_SIZE == 8 ? "long unsigned int" : "unsigned int") 541 | #define PTRDIFF_TYPE (INT_TYPE_SIZE == 8 ? "long int" :"int") 542 | 543 | +#define WCHAR_TYPE "int" 544 | +#define WINT_TYPE "int" 545 | #define WCHAR_TYPE_SIZE 16 546 | 547 | #define FIRST_PSEUDO_REGISTER 36 548 | @@ -563,6 +567,10 @@ 549 | /* 'true' - if current function is a signal function 550 | as specified by the "signal" attribute. */ 551 | int is_signal; 552 | + 553 | + /* 'true' - if current function is an nmi function 554 | + as specified by the "nmi" attribute. */ 555 | + int is_nmi; 556 | 557 | /* 'true' - if current function is a 'task' function 558 | as specified by the "OS_task" attribute. */ 559 | Only in gcc-7.3.0-patched/gcc/config/avr: avr.h.orig 560 | diff -ur gcc/gcc/config/avr/avr-mcus.def gcc-7.3.0-patched/gcc/config/avr/avr-mcus.def 561 | --- gcc/gcc/config/avr/avr-mcus.def 2017-01-01 13:07:43.905435000 +0100 562 | +++ gcc-7.3.0-patched/gcc/config/avr/avr-mcus.def 2018-12-03 11:57:10.211417460 +0100 563 | @@ -59,298 +59,319 @@ 564 | 565 | TEXT_START First address of Flash, used in -Ttext=. 566 | 567 | + NON_BIT_ADDRESSABLE_REG_MASK 568 | + Specify the mask for lower 32 IO registers that do not 569 | + support bit addressable instructions (e.g. sbi, sbic). 570 | + 571 | FLASH_SIZE Flash size in bytes. 572 | 573 | "avr2" must be first for the "0" default to work as intended. */ 574 | 575 | /* Classic, <= 8K. */ 576 | -AVR_MCU ("avr2", ARCH_AVR2, AVR_ERRATA_SKIP, NULL, 0x0060, 0x0, 0x60000) 577 | +AVR_MCU ("avr2", ARCH_AVR2, AVR_ERRATA_SKIP, NULL, 0x0060, 0x0, 0, 0x60000) 578 | 579 | -AVR_MCU ("at90s2313", ARCH_AVR2, AVR_SHORT_SP, "__AVR_AT90S2313__", 0x0060, 0x0, 0x800) 580 | -AVR_MCU ("at90s2323", ARCH_AVR2, AVR_SHORT_SP, "__AVR_AT90S2323__", 0x0060, 0x0, 0x800) 581 | -AVR_MCU ("at90s2333", ARCH_AVR2, AVR_SHORT_SP, "__AVR_AT90S2333__", 0x0060, 0x0, 0x800) 582 | -AVR_MCU ("at90s2343", ARCH_AVR2, AVR_SHORT_SP, "__AVR_AT90S2343__", 0x0060, 0x0, 0x800) 583 | -AVR_MCU ("attiny22", ARCH_AVR2, AVR_SHORT_SP, "__AVR_ATtiny22__", 0x0060, 0x0, 0x800) 584 | -AVR_MCU ("attiny26", ARCH_AVR2, AVR_SHORT_SP, "__AVR_ATtiny26__", 0x0060, 0x0, 0x800) 585 | -AVR_MCU ("at90s4414", ARCH_AVR2, AVR_ISA_NONE, "__AVR_AT90S4414__", 0x0060, 0x0, 0x1000) 586 | -AVR_MCU ("at90s4433", ARCH_AVR2, AVR_SHORT_SP, "__AVR_AT90S4433__", 0x0060, 0x0, 0x1000) 587 | -AVR_MCU ("at90s4434", ARCH_AVR2, AVR_ISA_NONE, "__AVR_AT90S4434__", 0x0060, 0x0, 0x1000) 588 | -AVR_MCU ("at90s8515", ARCH_AVR2, AVR_ERRATA_SKIP, "__AVR_AT90S8515__", 0x0060, 0x0, 0x2000) 589 | -AVR_MCU ("at90c8534", ARCH_AVR2, AVR_ISA_NONE, "__AVR_AT90C8534__", 0x0060, 0x0, 0x2000) 590 | -AVR_MCU ("at90s8535", ARCH_AVR2, AVR_ISA_NONE, "__AVR_AT90S8535__", 0x0060, 0x0, 0x2000) 591 | +AVR_MCU ("at90s2313", ARCH_AVR2, AVR_SHORT_SP, "__AVR_AT90S2313__", 0x0060, 0x0, 0, 0x800) 592 | +AVR_MCU ("at90s2323", ARCH_AVR2, AVR_SHORT_SP, "__AVR_AT90S2323__", 0x0060, 0x0, 0, 0x800) 593 | +AVR_MCU ("at90s2333", ARCH_AVR2, AVR_SHORT_SP, "__AVR_AT90S2333__", 0x0060, 0x0, 0, 0x800) 594 | +AVR_MCU ("at90s2343", ARCH_AVR2, AVR_SHORT_SP, "__AVR_AT90S2343__", 0x0060, 0x0, 0, 0x800) 595 | +AVR_MCU ("attiny22", ARCH_AVR2, AVR_SHORT_SP, "__AVR_ATtiny22__", 0x0060, 0x0, 0, 0x800) 596 | +AVR_MCU ("attiny26", ARCH_AVR2, AVR_SHORT_SP, "__AVR_ATtiny26__", 0x0060, 0x0, 0, 0x800) 597 | +AVR_MCU ("at90s4414", ARCH_AVR2, AVR_ISA_NONE, "__AVR_AT90S4414__", 0x0060, 0x0, 0, 0x1000) 598 | +AVR_MCU ("at90s4433", ARCH_AVR2, AVR_SHORT_SP, "__AVR_AT90S4433__", 0x0060, 0x0, 0, 0x1000) 599 | +AVR_MCU ("at90s4434", ARCH_AVR2, AVR_ISA_NONE, "__AVR_AT90S4434__", 0x0060, 0x0, 0, 0x1000) 600 | +AVR_MCU ("at90s8515", ARCH_AVR2, AVR_ERRATA_SKIP, "__AVR_AT90S8515__", 0x0060, 0x0, 0, 0x2000) 601 | +AVR_MCU ("at90c8534", ARCH_AVR2, AVR_ISA_NONE, "__AVR_AT90C8534__", 0x0060, 0x0, 0, 0x2000) 602 | +AVR_MCU ("at90s8535", ARCH_AVR2, AVR_ISA_NONE, "__AVR_AT90S8535__", 0x0060, 0x0, 0, 0x2000) 603 | /* Classic + MOVW, <= 8K. */ 604 | -AVR_MCU ("avr25", ARCH_AVR25, AVR_ISA_NONE, NULL, 0x0060, 0x0, 0x2000) 605 | -AVR_MCU ("ata5272", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATA5272__", 0x0100, 0x0, 0x2000) 606 | -AVR_MCU ("ata6616c", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATA6616C__", 0x0100, 0x0, 0x2000) 607 | -AVR_MCU ("attiny13", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny13__", 0x0060, 0x0, 0x400) 608 | -AVR_MCU ("attiny13a", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny13A__", 0x0060, 0x0, 0x400) 609 | -AVR_MCU ("attiny2313", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny2313__", 0x0060, 0x0, 0x800) 610 | -AVR_MCU ("attiny2313a", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny2313A__", 0x0060, 0x0, 0x800) 611 | -AVR_MCU ("attiny24", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny24__", 0x0060, 0x0, 0x800) 612 | -AVR_MCU ("attiny24a", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny24A__", 0x0060, 0x0, 0x800) 613 | -AVR_MCU ("attiny4313", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny4313__", 0x0060, 0x0, 0x1000) 614 | -AVR_MCU ("attiny44", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny44__", 0x0060, 0x0, 0x1000) 615 | -AVR_MCU ("attiny44a", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny44A__", 0x0060, 0x0, 0x1000) 616 | -AVR_MCU ("attiny441", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny441__", 0x0100, 0x0, 0x1000) 617 | -AVR_MCU ("attiny84", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny84__", 0x0060, 0x0, 0x2000) 618 | -AVR_MCU ("attiny84a", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny84A__", 0x0060, 0x0, 0x2000) 619 | -AVR_MCU ("attiny25", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny25__", 0x0060, 0x0, 0x800) 620 | -AVR_MCU ("attiny45", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny45__", 0x0060, 0x0, 0x1000) 621 | -AVR_MCU ("attiny85", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny85__", 0x0060, 0x0, 0x2000) 622 | -AVR_MCU ("attiny261", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny261__", 0x0060, 0x0, 0x800) 623 | -AVR_MCU ("attiny261a", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny261A__", 0x0060, 0x0, 0x800) 624 | -AVR_MCU ("attiny461", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny461__", 0x0060, 0x0, 0x1000) 625 | -AVR_MCU ("attiny461a", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny461A__", 0x0060, 0x0, 0x1000) 626 | -AVR_MCU ("attiny861", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny861__", 0x0060, 0x0, 0x2000) 627 | -AVR_MCU ("attiny861a", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny861A__", 0x0060, 0x0, 0x2000) 628 | -AVR_MCU ("attiny43u", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny43U__", 0x0060, 0x0, 0x1000) 629 | -AVR_MCU ("attiny87", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny87__", 0x0100, 0x0, 0x2000) 630 | -AVR_MCU ("attiny48", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny48__", 0x0100, 0x0, 0x1000) 631 | -AVR_MCU ("attiny88", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny88__", 0x0100, 0x0, 0x2000) 632 | -AVR_MCU ("attiny828", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny828__", 0x0100, 0x0, 0x2000) 633 | -AVR_MCU ("attiny841", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny841__", 0x0100, 0x0, 0x2000) 634 | -AVR_MCU ("at86rf401", ARCH_AVR25, AVR_ISA_NONE, "__AVR_AT86RF401__", 0x0060, 0x0, 0x800) 635 | +AVR_MCU ("avr25", ARCH_AVR25, AVR_ISA_NONE, NULL, 0x0060, 0x0, 0, 0x2000) 636 | +AVR_MCU ("ata5272", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATA5272__", 0x0100, 0x0, 0, 0x2000) 637 | +AVR_MCU ("ata6616c", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATA6616C__", 0x0100, 0x0, 0, 0x2000) 638 | +AVR_MCU ("attiny13", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny13__", 0x0060, 0x0, 0, 0x400) 639 | +AVR_MCU ("attiny13a", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny13A__", 0x0060, 0x0, 0, 0x400) 640 | +AVR_MCU ("attiny2313", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny2313__", 0x0060, 0x0, 0, 0x800) 641 | +AVR_MCU ("attiny2313a", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny2313A__", 0x0060, 0x0, 0, 0x800) 642 | +AVR_MCU ("attiny24", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny24__", 0x0060, 0x0, 0, 0x800) 643 | +AVR_MCU ("attiny24a", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny24A__", 0x0060, 0x0, 0, 0x800) 644 | +AVR_MCU ("attiny4313", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny4313__", 0x0060, 0x0, 0, 0x1000) 645 | +AVR_MCU ("attiny44", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny44__", 0x0060, 0x0, 0, 0x1000) 646 | +AVR_MCU ("attiny44a", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny44A__", 0x0060, 0x0, 0, 0x1000) 647 | +AVR_MCU ("attiny441", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny441__", 0x0100, 0x0, 0, 0x1000) 648 | +AVR_MCU ("attiny84", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny84__", 0x0060, 0x0, 0, 0x2000) 649 | +AVR_MCU ("attiny84a", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny84A__", 0x0060, 0x0, 0, 0x2000) 650 | +AVR_MCU ("attiny25", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny25__", 0x0060, 0x0, 0, 0x800) 651 | +AVR_MCU ("attiny45", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny45__", 0x0060, 0x0, 0, 0x1000) 652 | +AVR_MCU ("attiny85", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny85__", 0x0060, 0x0, 0, 0x2000) 653 | +AVR_MCU ("attiny261", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny261__", 0x0060, 0x0, 0, 0x800) 654 | +AVR_MCU ("attiny261a", ARCH_AVR25, AVR_SHORT_SP, "__AVR_ATtiny261A__", 0x0060, 0x0, 0, 0x800) 655 | +AVR_MCU ("attiny461", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny461__", 0x0060, 0x0, 0, 0x1000) 656 | +AVR_MCU ("attiny461a", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny461A__", 0x0060, 0x0, 0, 0x1000) 657 | +AVR_MCU ("attiny861", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny861__", 0x0060, 0x0, 0, 0x2000) 658 | +AVR_MCU ("attiny861a", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny861A__", 0x0060, 0x0, 0, 0x2000) 659 | +AVR_MCU ("attiny43u", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny43U__", 0x0060, 0x0, 0, 0x1000) 660 | +AVR_MCU ("attiny87", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny87__", 0x0100, 0x0, 0, 0x2000) 661 | +AVR_MCU ("attiny48", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny48__", 0x0100, 0x0, 0, 0x1000) 662 | +AVR_MCU ("attiny88", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny88__", 0x0100, 0x0, 0, 0x2000) 663 | +AVR_MCU ("attiny828", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny828__", 0x0100, 0x0, 0, 0x2000) 664 | +AVR_MCU ("attiny841", ARCH_AVR25, AVR_ISA_NONE, "__AVR_ATtiny841__", 0x0100, 0x0, 0, 0x2000) 665 | +AVR_MCU ("at86rf401", ARCH_AVR25, AVR_ISA_NONE, "__AVR_AT86RF401__", 0x0060, 0x0, 0, 0x800) 666 | /* Classic, > 8K, <= 64K. */ 667 | -AVR_MCU ("avr3", ARCH_AVR3, AVR_ISA_NONE, NULL, 0x0060, 0x0, 0x6000) 668 | -AVR_MCU ("at43usb355", ARCH_AVR3, AVR_ISA_NONE, "__AVR_AT43USB355__", 0x0060, 0x0, 0x6000) 669 | -AVR_MCU ("at76c711", ARCH_AVR3, AVR_ISA_NONE, "__AVR_AT76C711__", 0x0060, 0x0, 0x4000) 670 | +AVR_MCU ("avr3", ARCH_AVR3, AVR_ISA_NONE, NULL, 0x0060, 0x0, 0, 0x6000) 671 | +AVR_MCU ("at43usb355", ARCH_AVR3, AVR_ISA_NONE, "__AVR_AT43USB355__", 0x0060, 0x0, 0, 0x6000) 672 | +AVR_MCU ("at76c711", ARCH_AVR3, AVR_ISA_NONE, "__AVR_AT76C711__", 0x0060, 0x0, 0, 0x4000) 673 | /* Classic, == 128K. */ 674 | -AVR_MCU ("avr31", ARCH_AVR31, AVR_ERRATA_SKIP, NULL, 0x0060, 0x0, 0x20000) 675 | -AVR_MCU ("atmega103", ARCH_AVR31, AVR_ERRATA_SKIP, "__AVR_ATmega103__", 0x0060, 0x0, 0x20000) 676 | -AVR_MCU ("at43usb320", ARCH_AVR31, AVR_ISA_NONE, "__AVR_AT43USB320__", 0x0060, 0x0, 0x10000) 677 | +AVR_MCU ("avr31", ARCH_AVR31, AVR_ERRATA_SKIP, NULL, 0x0060, 0x0, 0, 0x20000) 678 | +AVR_MCU ("atmega103", ARCH_AVR31, AVR_ERRATA_SKIP, "__AVR_ATmega103__", 0x0060, 0x0, 0, 0x20000) 679 | +AVR_MCU ("at43usb320", ARCH_AVR31, AVR_ISA_NONE, "__AVR_AT43USB320__", 0x0060, 0x0, 0, 0x10000) 680 | /* Classic + MOVW + JMP/CALL. */ 681 | -AVR_MCU ("avr35", ARCH_AVR35, AVR_ISA_NONE, NULL, 0x0100, 0x0, 0x4000) 682 | -AVR_MCU ("ata5505", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATA5505__", 0x0100, 0x0, 0x4000) 683 | -AVR_MCU ("ata6617c", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATA6617C__", 0x0100, 0x0, 0x4000) 684 | -AVR_MCU ("ata664251", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATA664251__", 0x0100, 0x0, 0x4000) 685 | -AVR_MCU ("at90usb82", ARCH_AVR35, AVR_ISA_NONE, "__AVR_AT90USB82__", 0x0100, 0x0, 0x2000) 686 | -AVR_MCU ("at90usb162", ARCH_AVR35, AVR_ISA_NONE, "__AVR_AT90USB162__", 0x0100, 0x0, 0x4000) 687 | -AVR_MCU ("atmega8u2", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATmega8U2__", 0x0100, 0x0, 0x2000) 688 | -AVR_MCU ("atmega16u2", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATmega16U2__", 0x0100, 0x0, 0x4000) 689 | -AVR_MCU ("atmega32u2", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATmega32U2__", 0x0100, 0x0, 0x8000) 690 | -AVR_MCU ("attiny167", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATtiny167__", 0x0100, 0x0, 0x4000) 691 | -AVR_MCU ("attiny1634", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATtiny1634__", 0x0100, 0x0, 0x4000) 692 | +AVR_MCU ("avr35", ARCH_AVR35, AVR_ISA_NONE, NULL, 0x0100, 0x0, 0, 0x4000) 693 | +AVR_MCU ("ata5505", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATA5505__", 0x0100, 0x0, 0, 0x4000) 694 | +AVR_MCU ("ata6617c", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATA6617C__", 0x0100, 0x0, 0, 0x4000) 695 | +AVR_MCU ("ata664251", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATA664251__", 0x0100, 0x0, 0, 0x4000) 696 | +AVR_MCU ("at90usb82", ARCH_AVR35, AVR_ISA_NONE, "__AVR_AT90USB82__", 0x0100, 0x0, 0, 0x2000) 697 | +AVR_MCU ("at90usb162", ARCH_AVR35, AVR_ISA_NONE, "__AVR_AT90USB162__", 0x0100, 0x0, 0, 0x4000) 698 | +AVR_MCU ("atmega8u2", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATmega8U2__", 0x0100, 0x0, 0, 0x2000) 699 | +AVR_MCU ("atmega16u2", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATmega16U2__", 0x0100, 0x0, 0, 0x4000) 700 | +AVR_MCU ("atmega32u2", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATmega32U2__", 0x0100, 0x0, 0, 0x8000) 701 | +AVR_MCU ("attiny167", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATtiny167__", 0x0100, 0x0, 0, 0x4000) 702 | +AVR_MCU ("attiny1634", ARCH_AVR35, AVR_ISA_NONE, "__AVR_ATtiny1634__", 0x0100, 0x0, 0, 0x4000) 703 | /* Enhanced, <= 8K. */ 704 | -AVR_MCU ("avr4", ARCH_AVR4, AVR_ISA_NONE, NULL, 0x0060, 0x0, 0x2000) 705 | -AVR_MCU ("ata6285", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATA6285__", 0x0100, 0x0, 0x2000) 706 | -AVR_MCU ("ata6286", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATA6286__", 0x0100, 0x0, 0x2000) 707 | -AVR_MCU ("ata6289", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATA6289__", 0x0100, 0x0, 0x2000) 708 | -AVR_MCU ("ata6612c", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATA6612C__", 0x0100, 0x0, 0x2000) 709 | -AVR_MCU ("atmega8", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega8__", 0x0060, 0x0, 0x2000) 710 | -AVR_MCU ("atmega8a", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega8A__", 0x0060, 0x0, 0x2000) 711 | -AVR_MCU ("atmega48", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega48__", 0x0100, 0x0, 0x1000) 712 | -AVR_MCU ("atmega48a", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega48A__", 0x0100, 0x0, 0x1000) 713 | -AVR_MCU ("atmega48p", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega48P__", 0x0100, 0x0, 0x1000) 714 | -AVR_MCU ("atmega48pa", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega48PA__", 0x0100, 0x0, 0x1000) 715 | -AVR_MCU ("atmega48pb", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega48PB__", 0x0100, 0x0, 0x1000) 716 | -AVR_MCU ("atmega88", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega88__", 0x0100, 0x0, 0x2000) 717 | -AVR_MCU ("atmega88a", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega88A__", 0x0100, 0x0, 0x2000) 718 | -AVR_MCU ("atmega88p", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega88P__", 0x0100, 0x0, 0x2000) 719 | -AVR_MCU ("atmega88pa", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega88PA__", 0x0100, 0x0, 0x2000) 720 | -AVR_MCU ("atmega88pb", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega88PB__", 0x0100, 0x0, 0x2000) 721 | -AVR_MCU ("atmega8515", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega8515__", 0x0060, 0x0, 0x2000) 722 | -AVR_MCU ("atmega8535", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega8535__", 0x0060, 0x0, 0x2000) 723 | -AVR_MCU ("atmega8hva", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega8HVA__", 0x0100, 0x0, 0x2000) 724 | -AVR_MCU ("at90pwm1", ARCH_AVR4, AVR_ISA_NONE, "__AVR_AT90PWM1__", 0x0100, 0x0, 0x2000) 725 | -AVR_MCU ("at90pwm2", ARCH_AVR4, AVR_ISA_NONE, "__AVR_AT90PWM2__", 0x0100, 0x0, 0x2000) 726 | -AVR_MCU ("at90pwm2b", ARCH_AVR4, AVR_ISA_NONE, "__AVR_AT90PWM2B__", 0x0100, 0x0, 0x2000) 727 | -AVR_MCU ("at90pwm3", ARCH_AVR4, AVR_ISA_NONE, "__AVR_AT90PWM3__", 0x0100, 0x0, 0x2000) 728 | -AVR_MCU ("at90pwm3b", ARCH_AVR4, AVR_ISA_NONE, "__AVR_AT90PWM3B__", 0x0100, 0x0, 0x2000) 729 | -AVR_MCU ("at90pwm81", ARCH_AVR4, AVR_ISA_NONE, "__AVR_AT90PWM81__", 0x0100, 0x0, 0x2000) 730 | +AVR_MCU ("avr4", ARCH_AVR4, AVR_ISA_NONE, NULL, 0x0060, 0x0, 0, 0x2000) 731 | +AVR_MCU ("ata6285", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATA6285__", 0x0100, 0x0, 0, 0x2000) 732 | +AVR_MCU ("ata6286", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATA6286__", 0x0100, 0x0, 0, 0x2000) 733 | +AVR_MCU ("ata6289", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATA6289__", 0x0100, 0x0, 0, 0x2000) 734 | +AVR_MCU ("ata6612c", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATA6612C__", 0x0100, 0x0, 0, 0x2000) 735 | +AVR_MCU ("atmega8", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega8__", 0x0060, 0x0, 0, 0x2000) 736 | +AVR_MCU ("atmega8a", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega8A__", 0x0060, 0x0, 0, 0x2000) 737 | +AVR_MCU ("atmega48", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega48__", 0x0100, 0x0, 0, 0x1000) 738 | +AVR_MCU ("atmega48a", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega48A__", 0x0100, 0x0, 0, 0x1000) 739 | +AVR_MCU ("atmega48p", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega48P__", 0x0100, 0x0, 0, 0x1000) 740 | +AVR_MCU ("atmega48pa", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega48PA__", 0x0100, 0x0, 0, 0x1000) 741 | +AVR_MCU ("atmega48pb", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega48PB__", 0x0100, 0x0, 0, 0x1000) 742 | +AVR_MCU ("atmega88", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega88__", 0x0100, 0x0, 0, 0x2000) 743 | +AVR_MCU ("atmega88a", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega88A__", 0x0100, 0x0, 0, 0x2000) 744 | +AVR_MCU ("atmega88p", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega88P__", 0x0100, 0x0, 0, 0x2000) 745 | +AVR_MCU ("atmega88pa", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega88PA__", 0x0100, 0x0, 0, 0x2000) 746 | +AVR_MCU ("atmega88pb", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega88PB__", 0x0100, 0x0, 0, 0x2000) 747 | +AVR_MCU ("atmega8515", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega8515__", 0x0060, 0x0, 0, 0x2000) 748 | +AVR_MCU ("atmega8535", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega8535__", 0x0060, 0x0, 0, 0x2000) 749 | +AVR_MCU ("atmega8hva", ARCH_AVR4, AVR_ISA_NONE, "__AVR_ATmega8HVA__", 0x0100, 0x0, 0, 0x2000) 750 | +AVR_MCU ("at90pwm1", ARCH_AVR4, AVR_ISA_NONE, "__AVR_AT90PWM1__", 0x0100, 0x0, 0, 0x2000) 751 | +AVR_MCU ("at90pwm2", ARCH_AVR4, AVR_ISA_NONE, "__AVR_AT90PWM2__", 0x0100, 0x0, 0, 0x2000) 752 | +AVR_MCU ("at90pwm2b", ARCH_AVR4, AVR_ISA_NONE, "__AVR_AT90PWM2B__", 0x0100, 0x0, 0, 0x2000) 753 | +AVR_MCU ("at90pwm3", ARCH_AVR4, AVR_ISA_NONE, "__AVR_AT90PWM3__", 0x0100, 0x0, 0, 0x2000) 754 | +AVR_MCU ("at90pwm3b", ARCH_AVR4, AVR_ISA_NONE, "__AVR_AT90PWM3B__", 0x0100, 0x0, 0, 0x2000) 755 | +AVR_MCU ("at90pwm81", ARCH_AVR4, AVR_ISA_NONE, "__AVR_AT90PWM81__", 0x0100, 0x0, 0, 0x2000) 756 | /* Enhanced, > 8K, <= 64K. */ 757 | -AVR_MCU ("avr5", ARCH_AVR5, AVR_ISA_NONE, NULL, 0x0060, 0x0, 0x4000) 758 | -AVR_MCU ("ata5702m322", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5702M322__", 0x0200, 0x0, 0x10000) 759 | -AVR_MCU ("ata5782", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5782__", 0x0200, 0x8000, 0xd000) 760 | -AVR_MCU ("ata5790", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5790__", 0x0100, 0x0, 0x4000) 761 | -AVR_MCU ("ata5790n", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5790N__", 0x0100, 0x0, 0x4000) 762 | -AVR_MCU ("ata5791", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5791__", 0x0100, 0x0, 0x4000) 763 | -AVR_MCU ("ata5795", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5795__", 0x0100, 0x0, 0x2000) 764 | -AVR_MCU ("ata5831", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5831__", 0x0200, 0x8000, 0xd000) 765 | -AVR_MCU ("ata6613c", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA6613C__", 0x0100, 0x0, 0x4000) 766 | -AVR_MCU ("ata6614q", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA6614Q__", 0x0100, 0x0, 0x8000) 767 | -AVR_MCU ("ata8210", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA8210__", 0x0200, 0x8000, 0xd000) 768 | -AVR_MCU ("ata8510", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA8510__", 0x0200, 0x8000, 0xd000) 769 | -AVR_MCU ("atmega16", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16__", 0x0060, 0x0, 0x4000) 770 | -AVR_MCU ("atmega16a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16A__", 0x0060, 0x0, 0x4000) 771 | -AVR_MCU ("atmega161", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega161__", 0x0060, 0x0, 0x4000) 772 | -AVR_MCU ("atmega162", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega162__", 0x0100, 0x0, 0x4000) 773 | -AVR_MCU ("atmega163", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega163__", 0x0060, 0x0, 0x4000) 774 | -AVR_MCU ("atmega164a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega164A__", 0x0100, 0x0, 0x4000) 775 | -AVR_MCU ("atmega164p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega164P__", 0x0100, 0x0, 0x4000) 776 | -AVR_MCU ("atmega164pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega164PA__", 0x0100, 0x0, 0x4000) 777 | -AVR_MCU ("atmega165", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega165__", 0x0100, 0x0, 0x4000) 778 | -AVR_MCU ("atmega165a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega165A__", 0x0100, 0x0, 0x4000) 779 | -AVR_MCU ("atmega165p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega165P__", 0x0100, 0x0, 0x4000) 780 | -AVR_MCU ("atmega165pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega165PA__", 0x0100, 0x0, 0x4000) 781 | -AVR_MCU ("atmega168", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega168__", 0x0100, 0x0, 0x4000) 782 | -AVR_MCU ("atmega168a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega168A__", 0x0100, 0x0, 0x4000) 783 | -AVR_MCU ("atmega168p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega168P__", 0x0100, 0x0, 0x4000) 784 | -AVR_MCU ("atmega168pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega168PA__", 0x0100, 0x0, 0x4000) 785 | -AVR_MCU ("atmega168pb", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega168PB__", 0x0100, 0x0, 0x4000) 786 | -AVR_MCU ("atmega169", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega169__", 0x0100, 0x0, 0x4000) 787 | -AVR_MCU ("atmega169a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega169A__", 0x0100, 0x0, 0x4000) 788 | -AVR_MCU ("atmega169p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega169P__", 0x0100, 0x0, 0x4000) 789 | -AVR_MCU ("atmega169pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega169PA__", 0x0100, 0x0, 0x4000) 790 | -AVR_MCU ("atmega16hvb", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16HVB__", 0x0100, 0x0, 0x4000) 791 | -AVR_MCU ("atmega16hvbrevb", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16HVBREVB__", 0x0100, 0x0, 0x4000) 792 | -AVR_MCU ("atmega16m1", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16M1__", 0x0100, 0x0, 0x4000) 793 | -AVR_MCU ("atmega16u4", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16U4__", 0x0100, 0x0, 0x4000) 794 | -AVR_MCU ("atmega32a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32A__", 0x0060, 0x0, 0x8000) 795 | -AVR_MCU ("atmega32", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32__", 0x0060, 0x0, 0x8000) 796 | -AVR_MCU ("atmega323", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega323__", 0x0060, 0x0, 0x8000) 797 | -AVR_MCU ("atmega324a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega324A__", 0x0100, 0x0, 0x8000) 798 | -AVR_MCU ("atmega324p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega324P__", 0x0100, 0x0, 0x8000) 799 | -AVR_MCU ("atmega324pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega324PA__", 0x0100, 0x0, 0x8000) 800 | -AVR_MCU ("atmega325", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega325__", 0x0100, 0x0, 0x8000) 801 | -AVR_MCU ("atmega325a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega325A__", 0x0100, 0x0, 0x8000) 802 | -AVR_MCU ("atmega325p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega325P__", 0x0100, 0x0, 0x8000) 803 | -AVR_MCU ("atmega325pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega325PA__", 0x0100, 0x0, 0x8000) 804 | -AVR_MCU ("atmega3250", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3250__", 0x0100, 0x0, 0x8000) 805 | -AVR_MCU ("atmega3250a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3250A__", 0x0100, 0x0, 0x8000) 806 | -AVR_MCU ("atmega3250p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3250P__", 0x0100, 0x0, 0x8000) 807 | -AVR_MCU ("atmega3250pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3250PA__", 0x0100, 0x0, 0x8000) 808 | -AVR_MCU ("atmega328", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega328__", 0x0100, 0x0, 0x8000) 809 | -AVR_MCU ("atmega328p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega328P__", 0x0100, 0x0, 0x8000) 810 | -AVR_MCU ("atmega328pb", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega328PB__", 0x0100, 0x0, 0x8000) 811 | -AVR_MCU ("atmega329", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega329__", 0x0100, 0x0, 0x8000) 812 | -AVR_MCU ("atmega329a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega329A__", 0x0100, 0x0, 0x8000) 813 | -AVR_MCU ("atmega329p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega329P__", 0x0100, 0x0, 0x8000) 814 | -AVR_MCU ("atmega329pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega329PA__", 0x0100, 0x0, 0x8000) 815 | -AVR_MCU ("atmega3290", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3290__", 0x0100, 0x0, 0x8000) 816 | -AVR_MCU ("atmega3290a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3290A__", 0x0100, 0x0, 0x8000) 817 | -AVR_MCU ("atmega3290p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3290P__", 0x0100, 0x0, 0x8000) 818 | -AVR_MCU ("atmega3290pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3290PA__", 0x0100, 0x0, 0x8000) 819 | -AVR_MCU ("atmega32c1", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32C1__", 0x0100, 0x0, 0x8000) 820 | -AVR_MCU ("atmega32m1", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32M1__", 0x0100, 0x0, 0x8000) 821 | -AVR_MCU ("atmega32u4", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32U4__", 0x0100, 0x0, 0x8000) 822 | -AVR_MCU ("atmega32u6", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32U6__", 0x0100, 0x0, 0x8000) 823 | -AVR_MCU ("atmega406", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega406__", 0x0100, 0x0, 0xa000) 824 | -AVR_MCU ("atmega64", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64__", 0x0100, 0x0, 0x10000) 825 | -AVR_MCU ("atmega64a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64A__", 0x0100, 0x0, 0x10000) 826 | -AVR_MCU ("atmega640", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega640__", 0x0200, 0x0, 0x10000) 827 | -AVR_MCU ("atmega644", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega644__", 0x0100, 0x0, 0x10000) 828 | -AVR_MCU ("atmega644a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega644A__", 0x0100, 0x0, 0x10000) 829 | -AVR_MCU ("atmega644p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega644P__", 0x0100, 0x0, 0x10000) 830 | -AVR_MCU ("atmega644pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega644PA__", 0x0100, 0x0, 0x10000) 831 | -AVR_MCU ("atmega645", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega645__", 0x0100, 0x0, 0x10000) 832 | -AVR_MCU ("atmega645a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega645A__", 0x0100, 0x0, 0x10000) 833 | -AVR_MCU ("atmega645p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega645P__", 0x0100, 0x0, 0x10000) 834 | -AVR_MCU ("atmega6450", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega6450__", 0x0100, 0x0, 0x10000) 835 | -AVR_MCU ("atmega6450a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega6450A__", 0x0100, 0x0, 0x10000) 836 | -AVR_MCU ("atmega6450p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega6450P__", 0x0100, 0x0, 0x10000) 837 | -AVR_MCU ("atmega649", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega649__", 0x0100, 0x0, 0x10000) 838 | -AVR_MCU ("atmega649a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega649A__", 0x0100, 0x0, 0x10000) 839 | -AVR_MCU ("atmega649p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega649P__", 0x0100, 0x0, 0x10000) 840 | -AVR_MCU ("atmega6490", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega6490__", 0x0100, 0x0, 0x10000) 841 | -AVR_MCU ("atmega16hva", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16HVA__", 0x0100, 0x0, 0x4000) 842 | -AVR_MCU ("atmega16hva2", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16HVA2__", 0x0100, 0x0, 0x4000) 843 | -AVR_MCU ("atmega32hvb", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32HVB__", 0x0100, 0x0, 0x8000) 844 | -AVR_MCU ("atmega6490a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega6490A__", 0x0100, 0x0, 0x10000) 845 | -AVR_MCU ("atmega6490p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega6490P__", 0x0100, 0x0, 0x10000) 846 | -AVR_MCU ("atmega64c1", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64C1__", 0x0100, 0x0, 0x10000) 847 | -AVR_MCU ("atmega64m1", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64M1__", 0x0100, 0x0, 0x10000) 848 | -AVR_MCU ("atmega64hve", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64HVE__", 0x0100, 0x0, 0x10000) 849 | -AVR_MCU ("atmega64hve2", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64HVE2__", 0x0100, 0x0, 0x10000) 850 | -AVR_MCU ("atmega64rfr2", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64RFR2__", 0x0200, 0x0, 0x10000) 851 | -AVR_MCU ("atmega644rfr2", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega644RFR2__", 0x0200, 0x0, 0x10000) 852 | -AVR_MCU ("atmega32hvbrevb", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32HVBREVB__", 0x0100, 0x0, 0x8000) 853 | -AVR_MCU ("at90can32", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90CAN32__", 0x0100, 0x0, 0x8000) 854 | -AVR_MCU ("at90can64", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90CAN64__", 0x0100, 0x0, 0x10000) 855 | -AVR_MCU ("at90pwm161", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90PWM161__", 0x0100, 0x0, 0x4000) 856 | -AVR_MCU ("at90pwm216", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90PWM216__", 0x0100, 0x0, 0x4000) 857 | -AVR_MCU ("at90pwm316", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90PWM316__", 0x0100, 0x0, 0x4000) 858 | -AVR_MCU ("at90scr100", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90SCR100__", 0x0100, 0x0, 0x10000) 859 | -AVR_MCU ("at90usb646", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90USB646__", 0x0100, 0x0, 0x10000) 860 | -AVR_MCU ("at90usb647", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90USB647__", 0x0100, 0x0, 0x10000) 861 | -AVR_MCU ("at94k", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT94K__", 0x0060, 0x0, 0x8000) 862 | -AVR_MCU ("m3000", ARCH_AVR5, AVR_ISA_NONE, "__AVR_M3000__", 0x1000, 0x0, 0x10000) 863 | +AVR_MCU ("avr5", ARCH_AVR5, AVR_ISA_NONE, NULL, 0x0060, 0x0, 0, 0x4000) 864 | +AVR_MCU ("ata5702m322", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5702M322__", 0x0200, 0x0, 0, 0x10000) 865 | +AVR_MCU ("ata5782", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5782__", 0x0200, 0x8000, 0, 0xd000) 866 | +AVR_MCU ("ata5790", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5790__", 0x0100, 0x0, 0, 0x4000) 867 | +AVR_MCU ("ata5790n", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5790N__", 0x0100, 0x0, 0, 0x4000) 868 | +AVR_MCU ("ata5791", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5791__", 0x0100, 0x0, 0, 0x4000) 869 | +AVR_MCU ("ata5795", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5795__", 0x0100, 0x0, 0, 0x2000) 870 | +AVR_MCU ("ata5831", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA5831__", 0x0200, 0x8000, 0, 0xd000) 871 | +AVR_MCU ("ata6613c", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA6613C__", 0x0100, 0x0, 0, 0x4000) 872 | +AVR_MCU ("ata6614q", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA6614Q__", 0x0100, 0x0, 0, 0x8000) 873 | +AVR_MCU ("ata8210", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA8210__", 0x0200, 0x8000, 0, 0xd000) 874 | +AVR_MCU ("ata8510", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATA8510__", 0x0200, 0x8000, 0, 0xd000) 875 | +AVR_MCU ("atmega16", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16__", 0x0060, 0x0, 0, 0x4000) 876 | +AVR_MCU ("atmega16a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16A__", 0x0060, 0x0, 0, 0x4000) 877 | +AVR_MCU ("atmega161", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega161__", 0x0060, 0x0, 0, 0x4000) 878 | +AVR_MCU ("atmega162", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega162__", 0x0100, 0x0, 0, 0x4000) 879 | +AVR_MCU ("atmega163", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega163__", 0x0060, 0x0, 0, 0x4000) 880 | +AVR_MCU ("atmega164a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega164A__", 0x0100, 0x0, 0, 0x4000) 881 | +AVR_MCU ("atmega164p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega164P__", 0x0100, 0x0, 0, 0x4000) 882 | +AVR_MCU ("atmega164pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega164PA__", 0x0100, 0x0, 0, 0x4000) 883 | +AVR_MCU ("atmega165", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega165__", 0x0100, 0x0, 0, 0x4000) 884 | +AVR_MCU ("atmega165a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega165A__", 0x0100, 0x0, 0, 0x4000) 885 | +AVR_MCU ("atmega165p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega165P__", 0x0100, 0x0, 0, 0x4000) 886 | +AVR_MCU ("atmega165pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega165PA__", 0x0100, 0x0, 0, 0x4000) 887 | +AVR_MCU ("atmega168", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega168__", 0x0100, 0x0, 0, 0x4000) 888 | +AVR_MCU ("atmega168a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega168A__", 0x0100, 0x0, 0, 0x4000) 889 | +AVR_MCU ("atmega168p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega168P__", 0x0100, 0x0, 0, 0x4000) 890 | +AVR_MCU ("atmega168pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega168PA__", 0x0100, 0x0, 0, 0x4000) 891 | +AVR_MCU ("atmega168pb", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega168PB__", 0x0100, 0x0, 0, 0x4000) 892 | +AVR_MCU ("atmega169", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega169__", 0x0100, 0x0, 0, 0x4000) 893 | +AVR_MCU ("atmega169a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega169A__", 0x0100, 0x0, 0, 0x4000) 894 | +AVR_MCU ("atmega169p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega169P__", 0x0100, 0x0, 0, 0x4000) 895 | +AVR_MCU ("atmega169pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega169PA__", 0x0100, 0x0, 0, 0x4000) 896 | +AVR_MCU ("atmega16hvb", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16HVB__", 0x0100, 0x0, 0, 0x4000) 897 | +AVR_MCU ("atmega16hvbrevb", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16HVBREVB__", 0x0100, 0x0, 0, 0x4000) 898 | +AVR_MCU ("atmega16m1", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16M1__", 0x0100, 0x0, 0, 0x4000) 899 | +AVR_MCU ("atmega16u4", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16U4__", 0x0100, 0x0, 0, 0x4000) 900 | +AVR_MCU ("atmega32a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32A__", 0x0060, 0x0, 0, 0x8000) 901 | +AVR_MCU ("atmega32", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32__", 0x0060, 0x0, 0, 0x8000) 902 | +AVR_MCU ("atmega323", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega323__", 0x0060, 0x0, 0, 0x8000) 903 | +AVR_MCU ("atmega324a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega324A__", 0x0100, 0x0, 0, 0x8000) 904 | +AVR_MCU ("atmega324p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega324P__", 0x0100, 0x0, 0, 0x8000) 905 | +AVR_MCU ("atmega324pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega324PA__", 0x0100, 0x0, 0, 0x8000) 906 | +AVR_MCU ("atmega325", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega325__", 0x0100, 0x0, 0, 0x8000) 907 | +AVR_MCU ("atmega325a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega325A__", 0x0100, 0x0, 0, 0x8000) 908 | +AVR_MCU ("atmega325p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega325P__", 0x0100, 0x0, 0, 0x8000) 909 | +AVR_MCU ("atmega325pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega325PA__", 0x0100, 0x0, 0, 0x8000) 910 | +AVR_MCU ("atmega3250", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3250__", 0x0100, 0x0, 0, 0x8000) 911 | +AVR_MCU ("atmega3250a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3250A__", 0x0100, 0x0, 0, 0x8000) 912 | +AVR_MCU ("atmega3250p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3250P__", 0x0100, 0x0, 0, 0x8000) 913 | +AVR_MCU ("atmega3250pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3250PA__", 0x0100, 0x0, 0, 0x8000) 914 | +AVR_MCU ("atmega328", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega328__", 0x0100, 0x0, 0, 0x8000) 915 | +AVR_MCU ("atmega328p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega328P__", 0x0100, 0x0, 0, 0x8000) 916 | +AVR_MCU ("atmega328pb", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega328PB__", 0x0100, 0x0, 0, 0x8000) 917 | +AVR_MCU ("atmega329", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega329__", 0x0100, 0x0, 0, 0x8000) 918 | +AVR_MCU ("atmega329a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega329A__", 0x0100, 0x0, 0, 0x8000) 919 | +AVR_MCU ("atmega329p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega329P__", 0x0100, 0x0, 0, 0x8000) 920 | +AVR_MCU ("atmega329pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega329PA__", 0x0100, 0x0, 0, 0x8000) 921 | +AVR_MCU ("atmega3290", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3290__", 0x0100, 0x0, 0, 0x8000) 922 | +AVR_MCU ("atmega3290a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3290A__", 0x0100, 0x0, 0, 0x8000) 923 | +AVR_MCU ("atmega3290p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3290P__", 0x0100, 0x0, 0, 0x8000) 924 | +AVR_MCU ("atmega3290pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega3290PA__", 0x0100, 0x0, 0, 0x8000) 925 | +AVR_MCU ("atmega32c1", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32C1__", 0x0100, 0x0, 0, 0x8000) 926 | +AVR_MCU ("atmega32m1", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32M1__", 0x0100, 0x0, 0, 0x8000) 927 | +AVR_MCU ("atmega32u4", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32U4__", 0x0100, 0x0, 0, 0x8000) 928 | +AVR_MCU ("atmega32u6", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32U6__", 0x0100, 0x0, 0, 0x8000) 929 | +AVR_MCU ("atmega406", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega406__", 0x0100, 0x0, 0, 0xa000) 930 | +AVR_MCU ("atmega64", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64__", 0x0100, 0x0, 0, 0x10000) 931 | +AVR_MCU ("atmega64a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64A__", 0x0100, 0x0, 0, 0x10000) 932 | +AVR_MCU ("atmega640", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega640__", 0x0200, 0x0, 0, 0x10000) 933 | +AVR_MCU ("atmega644", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega644__", 0x0100, 0x0, 0, 0x10000) 934 | +AVR_MCU ("atmega644a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega644A__", 0x0100, 0x0, 0, 0x10000) 935 | +AVR_MCU ("atmega644p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega644P__", 0x0100, 0x0, 0, 0x10000) 936 | +AVR_MCU ("atmega644pa", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega644PA__", 0x0100, 0x0, 0, 0x10000) 937 | +AVR_MCU ("atmega645", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega645__", 0x0100, 0x0, 0, 0x10000) 938 | +AVR_MCU ("atmega645a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega645A__", 0x0100, 0x0, 0, 0x10000) 939 | +AVR_MCU ("atmega645p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega645P__", 0x0100, 0x0, 0, 0x10000) 940 | +AVR_MCU ("atmega6450", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega6450__", 0x0100, 0x0, 0, 0x10000) 941 | +AVR_MCU ("atmega6450a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega6450A__", 0x0100, 0x0, 0, 0x10000) 942 | +AVR_MCU ("atmega6450p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega6450P__", 0x0100, 0x0, 0, 0x10000) 943 | +AVR_MCU ("atmega649", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega649__", 0x0100, 0x0, 0, 0x10000) 944 | +AVR_MCU ("atmega649a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega649A__", 0x0100, 0x0, 0, 0x10000) 945 | +AVR_MCU ("atmega649p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega649P__", 0x0100, 0x0, 0, 0x10000) 946 | +AVR_MCU ("atmega6490", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega6490__", 0x0100, 0x0, 0, 0x10000) 947 | +AVR_MCU ("atmega16hva", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16HVA__", 0x0100, 0x0, 0, 0x4000) 948 | +AVR_MCU ("atmega16hva2", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega16HVA2__", 0x0100, 0x0, 0, 0x4000) 949 | +AVR_MCU ("atmega32hvb", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32HVB__", 0x0100, 0x0, 0, 0x8000) 950 | +AVR_MCU ("atmega6490a", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega6490A__", 0x0100, 0x0, 0, 0x10000) 951 | +AVR_MCU ("atmega6490p", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega6490P__", 0x0100, 0x0, 0, 0x10000) 952 | +AVR_MCU ("atmega64c1", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64C1__", 0x0100, 0x0, 0, 0x10000) 953 | +AVR_MCU ("atmega64m1", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64M1__", 0x0100, 0x0, 0, 0x10000) 954 | +AVR_MCU ("atmega64hve", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64HVE__", 0x0100, 0x0, 0, 0x10000) 955 | +AVR_MCU ("atmega64hve2", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64HVE2__", 0x0100, 0x0, 0, 0x10000) 956 | +AVR_MCU ("atmega64rfr2", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega64RFR2__", 0x0200, 0x0, 0, 0x10000) 957 | +AVR_MCU ("atmega644rfr2", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega644RFR2__", 0x0200, 0x0, 0, 0x10000) 958 | +AVR_MCU ("atmega32hvbrevb", ARCH_AVR5, AVR_ISA_NONE, "__AVR_ATmega32HVBREVB__", 0x0100, 0x0, 0, 0x8000) 959 | +AVR_MCU ("at90can32", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90CAN32__", 0x0100, 0x0, 0, 0x8000) 960 | +AVR_MCU ("at90can64", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90CAN64__", 0x0100, 0x0, 0, 0x10000) 961 | +AVR_MCU ("at90pwm161", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90PWM161__", 0x0100, 0x0, 0, 0x4000) 962 | +AVR_MCU ("at90pwm216", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90PWM216__", 0x0100, 0x0, 0, 0x4000) 963 | +AVR_MCU ("at90pwm316", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90PWM316__", 0x0100, 0x0, 0, 0x4000) 964 | +AVR_MCU ("at90scr100", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90SCR100__", 0x0100, 0x0, 0, 0x10000) 965 | +AVR_MCU ("at90usb646", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90USB646__", 0x0100, 0x0, 0, 0x10000) 966 | +AVR_MCU ("at90usb647", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT90USB647__", 0x0100, 0x0, 0, 0x10000) 967 | +AVR_MCU ("at94k", ARCH_AVR5, AVR_ISA_NONE, "__AVR_AT94K__", 0x0060, 0x0, 0, 0x8000) 968 | +AVR_MCU ("m3000", ARCH_AVR5, AVR_ISA_NONE, "__AVR_M3000__", 0x1000, 0x0, 0, 0x10000) 969 | /* Enhanced, == 128K. */ 970 | -AVR_MCU ("avr51", ARCH_AVR51, AVR_ISA_NONE, NULL, 0x0100, 0x0, 0x20000) 971 | -AVR_MCU ("atmega128", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega128__", 0x0100, 0x0, 0x20000) 972 | -AVR_MCU ("atmega128a", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega128A__", 0x0100, 0x0, 0x20000) 973 | -AVR_MCU ("atmega1280", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega1280__", 0x0200, 0x0, 0x20000) 974 | -AVR_MCU ("atmega1281", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega1281__", 0x0200, 0x0, 0x20000) 975 | -AVR_MCU ("atmega1284", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega1284__", 0x0100, 0x0, 0x20000) 976 | -AVR_MCU ("atmega1284p", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega1284P__", 0x0100, 0x0, 0x20000) 977 | -AVR_MCU ("atmega128rfa1", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega128RFA1__", 0x0200, 0x0, 0x20000) 978 | -AVR_MCU ("atmega128rfr2", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega128RFR2__", 0x0200, 0x0, 0x20000) 979 | -AVR_MCU ("atmega1284rfr2", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega1284RFR2__", 0x0200, 0x0, 0x20000) 980 | -AVR_MCU ("at90can128", ARCH_AVR51, AVR_ISA_NONE, "__AVR_AT90CAN128__", 0x0100, 0x0, 0x20000) 981 | -AVR_MCU ("at90usb1286", ARCH_AVR51, AVR_ISA_NONE, "__AVR_AT90USB1286__", 0x0100, 0x0, 0x20000) 982 | -AVR_MCU ("at90usb1287", ARCH_AVR51, AVR_ISA_NONE, "__AVR_AT90USB1287__", 0x0100, 0x0, 0x20000) 983 | +AVR_MCU ("avr51", ARCH_AVR51, AVR_ISA_NONE, NULL, 0x0100, 0x0, 0, 0x20000) 984 | +AVR_MCU ("atmega128", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega128__", 0x0100, 0x0, 0, 0x20000) 985 | +AVR_MCU ("atmega128a", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega128A__", 0x0100, 0x0, 0, 0x20000) 986 | +AVR_MCU ("atmega1280", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega1280__", 0x0200, 0x0, 0, 0x20000) 987 | +AVR_MCU ("atmega1281", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega1281__", 0x0200, 0x0, 0, 0x20000) 988 | +AVR_MCU ("atmega1284", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega1284__", 0x0100, 0x0, 0, 0x20000) 989 | +AVR_MCU ("atmega1284p", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega1284P__", 0x0100, 0x0, 0, 0x20000) 990 | +AVR_MCU ("atmega128rfa1", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega128RFA1__", 0x0200, 0x0, 0, 0x20000) 991 | +AVR_MCU ("atmega128rfr2", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega128RFR2__", 0x0200, 0x0, 0, 0x20000) 992 | +AVR_MCU ("atmega1284rfr2", ARCH_AVR51, AVR_ISA_NONE, "__AVR_ATmega1284RFR2__", 0x0200, 0x0, 0, 0x20000) 993 | +AVR_MCU ("at90can128", ARCH_AVR51, AVR_ISA_NONE, "__AVR_AT90CAN128__", 0x0100, 0x0, 0, 0x20000) 994 | +AVR_MCU ("at90usb1286", ARCH_AVR51, AVR_ISA_NONE, "__AVR_AT90USB1286__", 0x0100, 0x0, 0, 0x20000) 995 | +AVR_MCU ("at90usb1287", ARCH_AVR51, AVR_ISA_NONE, "__AVR_AT90USB1287__", 0x0100, 0x0, 0, 0x20000) 996 | /* 3-Byte PC. */ 997 | -AVR_MCU ("avr6", ARCH_AVR6, AVR_ISA_NONE, NULL, 0x0200, 0x0, 0x40000) 998 | -AVR_MCU ("atmega2560", ARCH_AVR6, AVR_ISA_NONE, "__AVR_ATmega2560__", 0x0200, 0x0, 0x40000) 999 | -AVR_MCU ("atmega2561", ARCH_AVR6, AVR_ISA_NONE, "__AVR_ATmega2561__", 0x0200, 0x0, 0x40000) 1000 | -AVR_MCU ("atmega256rfr2", ARCH_AVR6, AVR_ISA_NONE, "__AVR_ATmega256RFR2__", 0x0200, 0x0, 0x40000) 1001 | -AVR_MCU ("atmega2564rfr2", ARCH_AVR6, AVR_ISA_NONE, "__AVR_ATmega2564RFR2__", 0x0200, 0x0, 0x40000) 1002 | +AVR_MCU ("avr6", ARCH_AVR6, AVR_ISA_NONE, NULL, 0x0200, 0x0, 0, 0x40000) 1003 | +AVR_MCU ("atmega2560", ARCH_AVR6, AVR_ISA_NONE, "__AVR_ATmega2560__", 0x0200, 0x0, 0, 0x40000) 1004 | +AVR_MCU ("atmega2561", ARCH_AVR6, AVR_ISA_NONE, "__AVR_ATmega2561__", 0x0200, 0x0, 0, 0x40000) 1005 | +AVR_MCU ("atmega256rfr2", ARCH_AVR6, AVR_ISA_NONE, "__AVR_ATmega256RFR2__", 0x0200, 0x0, 0, 0x40000) 1006 | +AVR_MCU ("atmega2564rfr2", ARCH_AVR6, AVR_ISA_NONE, "__AVR_ATmega2564RFR2__", 0x0200, 0x0, 0, 0x40000) 1007 | /* Xmega, 16K <= Flash < 64K, RAM <= 64K */ 1008 | -AVR_MCU ("avrxmega2", ARCH_AVRXMEGA2, AVR_ISA_NONE, NULL, 0x2000, 0x0, 0x9000) 1009 | -AVR_MCU ("atxmega8e5", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega8E5__", 0x2000, 0x0, 0x2800) 1010 | -AVR_MCU ("atxmega16a4", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega16A4__", 0x2000, 0x0, 0x5000) 1011 | -AVR_MCU ("atxmega16d4", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega16D4__", 0x2000, 0x0, 0x5000) 1012 | -AVR_MCU ("atxmega16e5", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega16E5__", 0x2000, 0x0, 0x5000) 1013 | -AVR_MCU ("atxmega32a4", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega32A4__", 0x2000, 0x0, 0x9000) 1014 | -AVR_MCU ("atxmega32c3", ARCH_AVRXMEGA2, AVR_ISA_RMW, "__AVR_ATxmega32C3__", 0x2000, 0x0, 0x9000) 1015 | -AVR_MCU ("atxmega32d3", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega32D3__", 0x2000, 0x0, 0x9000) 1016 | -AVR_MCU ("atxmega32d4", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega32D4__", 0x2000, 0x0, 0x9000) 1017 | -AVR_MCU ("atxmega16a4u", ARCH_AVRXMEGA2, AVR_ISA_RMW, "__AVR_ATxmega16A4U__", 0x2000, 0x0, 0x5000) 1018 | -AVR_MCU ("atxmega16c4", ARCH_AVRXMEGA2, AVR_ISA_RMW, "__AVR_ATxmega16C4__", 0x2000, 0x0, 0x5000) 1019 | -AVR_MCU ("atxmega32a4u", ARCH_AVRXMEGA2, AVR_ISA_RMW, "__AVR_ATxmega32A4U__", 0x2000, 0x0, 0x9000) 1020 | -AVR_MCU ("atxmega32c4", ARCH_AVRXMEGA2, AVR_ISA_RMW, "__AVR_ATxmega32C4__", 0x2000, 0x0, 0x9000) 1021 | -AVR_MCU ("atxmega32e5", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega32E5__", 0x2000, 0x0, 0x9000) 1022 | +AVR_MCU ("avrxmega2", ARCH_AVRXMEGA2, AVR_ISA_NONE, NULL, 0x2000, 0x0, 0, 0x9000) 1023 | +AVR_MCU ("atxmega8e5", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega8E5__", 0x2000, 0x0, 0, 0x2800) 1024 | +AVR_MCU ("atxmega16a4", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega16A4__", 0x2000, 0x0, 0, 0x5000) 1025 | +AVR_MCU ("atxmega16d4", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega16D4__", 0x2000, 0x0, 0, 0x5000) 1026 | +AVR_MCU ("atxmega16e5", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega16E5__", 0x2000, 0x0, 0, 0x5000) 1027 | +AVR_MCU ("atxmega32a4", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega32A4__", 0x2000, 0x0, 0, 0x9000) 1028 | +AVR_MCU ("atxmega32c3", ARCH_AVRXMEGA2, AVR_ISA_RMW, "__AVR_ATxmega32C3__", 0x2000, 0x0, 0, 0x9000) 1029 | +AVR_MCU ("atxmega32d3", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega32D3__", 0x2000, 0x0, 0, 0x9000) 1030 | +AVR_MCU ("atxmega32d4", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega32D4__", 0x2000, 0x0, 0, 0x9000) 1031 | +AVR_MCU ("atxmega16a4u", ARCH_AVRXMEGA2, AVR_ISA_RMW, "__AVR_ATxmega16A4U__", 0x2000, 0x0, 0, 0x5000) 1032 | +AVR_MCU ("atxmega16c4", ARCH_AVRXMEGA2, AVR_ISA_RMW, "__AVR_ATxmega16C4__", 0x2000, 0x0, 0, 0x5000) 1033 | +AVR_MCU ("atxmega32a4u", ARCH_AVRXMEGA2, AVR_ISA_RMW, "__AVR_ATxmega32A4U__", 0x2000, 0x0, 0, 0x9000) 1034 | +AVR_MCU ("atxmega32c4", ARCH_AVRXMEGA2, AVR_ISA_RMW, "__AVR_ATxmega32C4__", 0x2000, 0x0, 0, 0x9000) 1035 | +AVR_MCU ("atxmega32e5", ARCH_AVRXMEGA2, AVR_ISA_NONE, "__AVR_ATxmega32E5__", 0x2000, 0x0, 0, 0x9000) 1036 | +/* Xmega, Flash + RAM < 64K, flash visible in RAM address space */ 1037 | +AVR_MCU ("avrxmega3", ARCH_AVRXMEGA3, AVR_ISA_NONE, NULL, 0x3f00, 0x0, 0, 0x8000) 1038 | +AVR_MCU ("attiny212", ARCH_AVRXMEGA3, AVR_ISA_RCALL, "__AVR_ATtiny212__", 0x3f80, 0x0, 0, 0x800) 1039 | +AVR_MCU ("attiny214", ARCH_AVRXMEGA3, AVR_ISA_RCALL, "__AVR_ATtiny214__", 0x3f80, 0x0, 0, 0x800) 1040 | +AVR_MCU ("attiny412", ARCH_AVRXMEGA3, AVR_ISA_RCALL, "__AVR_ATtiny412__", 0x3f00, 0x0, 0, 0x1000) 1041 | +AVR_MCU ("attiny414", ARCH_AVRXMEGA3, AVR_ISA_RCALL, "__AVR_ATtiny414__", 0x3f00, 0x0, 0, 0x1000) 1042 | +AVR_MCU ("attiny416", ARCH_AVRXMEGA3, AVR_ISA_RCALL, "__AVR_ATtiny416__", 0x3f00, 0x0, 0, 0x1000) 1043 | +AVR_MCU ("attiny417", ARCH_AVRXMEGA3, AVR_ISA_RCALL, "__AVR_ATtiny417__", 0x3f00, 0x0, 0, 0x1000) 1044 | +AVR_MCU ("attiny814", ARCH_AVRXMEGA3, AVR_ISA_RCALL, "__AVR_ATtiny814__", 0x3e00, 0x0, 0, 0x2000) 1045 | +AVR_MCU ("attiny816", ARCH_AVRXMEGA3, AVR_ISA_RCALL, "__AVR_ATtiny816__", 0x3e00, 0x0, 0, 0x2000) 1046 | +AVR_MCU ("attiny817", ARCH_AVRXMEGA3, AVR_ISA_RCALL, "__AVR_ATtiny817__", 0x3e00, 0x0, 0, 0x2000) 1047 | +AVR_MCU ("attiny1614", ARCH_AVRXMEGA3, AVR_ISA_NONE, "__AVR_ATtiny1614__", 0x3800, 0x0, 0, 0x4000) 1048 | +AVR_MCU ("attiny1616", ARCH_AVRXMEGA3, AVR_ISA_NONE, "__AVR_ATtiny1616__", 0x3800, 0x0, 0, 0x4000) 1049 | +AVR_MCU ("attiny1617", ARCH_AVRXMEGA3, AVR_ISA_NONE, "__AVR_ATtiny1617__", 0x3800, 0x0, 0, 0x4000) 1050 | +AVR_MCU ("attiny3214", ARCH_AVRXMEGA3, AVR_ISA_NONE, "__AVR_ATtiny3214__", 0x3800, 0x0, 0, 0x8000) 1051 | +AVR_MCU ("attiny3216", ARCH_AVRXMEGA3, AVR_ISA_NONE, "__AVR_ATtiny3216__", 0x3800, 0x0, 0, 0x8000) 1052 | +AVR_MCU ("attiny3217", ARCH_AVRXMEGA3, AVR_ISA_NONE, "__AVR_ATtiny3217__", 0x3800, 0x0, 0, 0x8000) 1053 | /* Xmega, 64K < Flash <= 128K, RAM <= 64K */ 1054 | -AVR_MCU ("avrxmega4", ARCH_AVRXMEGA4, AVR_ISA_NONE, NULL, 0x2000, 0x0, 0x11000) 1055 | -AVR_MCU ("atxmega64a3", ARCH_AVRXMEGA4, AVR_ISA_NONE, "__AVR_ATxmega64A3__", 0x2000, 0x0, 0x11000) 1056 | -AVR_MCU ("atxmega64d3", ARCH_AVRXMEGA4, AVR_ISA_NONE, "__AVR_ATxmega64D3__", 0x2000, 0x0, 0x11000) 1057 | -AVR_MCU ("atxmega64a3u", ARCH_AVRXMEGA4, AVR_ISA_RMW, "__AVR_ATxmega64A3U__", 0x2000, 0x0, 0x11000) 1058 | -AVR_MCU ("atxmega64a4u", ARCH_AVRXMEGA4, AVR_ISA_RMW, "__AVR_ATxmega64A4U__", 0x2000, 0x0, 0x11000) 1059 | -AVR_MCU ("atxmega64b1", ARCH_AVRXMEGA4, AVR_ISA_RMW, "__AVR_ATxmega64B1__", 0x2000, 0x0, 0x11000) 1060 | -AVR_MCU ("atxmega64b3", ARCH_AVRXMEGA4, AVR_ISA_RMW, "__AVR_ATxmega64B3__", 0x2000, 0x0, 0x11000) 1061 | -AVR_MCU ("atxmega64c3", ARCH_AVRXMEGA4, AVR_ISA_RMW, "__AVR_ATxmega64C3__", 0x2000, 0x0, 0x11000) 1062 | -AVR_MCU ("atxmega64d4", ARCH_AVRXMEGA4, AVR_ISA_NONE, "__AVR_ATxmega64D4__", 0x2000, 0x0, 0x11000) 1063 | +AVR_MCU ("avrxmega4", ARCH_AVRXMEGA4, AVR_ISA_NONE, NULL, 0x2000, 0x0, 0, 0x11000) 1064 | +AVR_MCU ("atxmega64a3", ARCH_AVRXMEGA4, AVR_ISA_NONE, "__AVR_ATxmega64A3__", 0x2000, 0x0, 0, 0x11000) 1065 | +AVR_MCU ("atxmega64d3", ARCH_AVRXMEGA4, AVR_ISA_NONE, "__AVR_ATxmega64D3__", 0x2000, 0x0, 0, 0x11000) 1066 | +AVR_MCU ("atxmega64a3u", ARCH_AVRXMEGA4, AVR_ISA_RMW, "__AVR_ATxmega64A3U__", 0x2000, 0x0, 0, 0x11000) 1067 | +AVR_MCU ("atxmega64a4u", ARCH_AVRXMEGA4, AVR_ISA_RMW, "__AVR_ATxmega64A4U__", 0x2000, 0x0, 0, 0x11000) 1068 | +AVR_MCU ("atxmega64b1", ARCH_AVRXMEGA4, AVR_ISA_RMW, "__AVR_ATxmega64B1__", 0x2000, 0x0, 0, 0x11000) 1069 | +AVR_MCU ("atxmega64b3", ARCH_AVRXMEGA4, AVR_ISA_RMW, "__AVR_ATxmega64B3__", 0x2000, 0x0, 0, 0x11000) 1070 | +AVR_MCU ("atxmega64c3", ARCH_AVRXMEGA4, AVR_ISA_RMW, "__AVR_ATxmega64C3__", 0x2000, 0x0, 0, 0x11000) 1071 | +AVR_MCU ("atxmega64d4", ARCH_AVRXMEGA4, AVR_ISA_NONE, "__AVR_ATxmega64D4__", 0x2000, 0x0, 0, 0x11000) 1072 | /* Xmega, 64K < Flash <= 128K, RAM > 64K */ 1073 | -AVR_MCU ("avrxmega5", ARCH_AVRXMEGA5, AVR_ISA_NONE, NULL, 0x2000, 0x0, 0x11000) 1074 | -AVR_MCU ("atxmega64a1", ARCH_AVRXMEGA5, AVR_ISA_NONE, "__AVR_ATxmega64A1__", 0x2000, 0x0, 0x11000) 1075 | -AVR_MCU ("atxmega64a1u", ARCH_AVRXMEGA5, AVR_ISA_RMW, "__AVR_ATxmega64A1U__", 0x2000, 0x0, 0x11000) 1076 | +AVR_MCU ("avrxmega5", ARCH_AVRXMEGA5, AVR_ISA_NONE, NULL, 0x2000, 0x0, 0, 0x11000) 1077 | +AVR_MCU ("atxmega64a1", ARCH_AVRXMEGA5, AVR_ISA_NONE, "__AVR_ATxmega64A1__", 0x2000, 0x0, 0, 0x11000) 1078 | +AVR_MCU ("atxmega64a1u", ARCH_AVRXMEGA5, AVR_ISA_RMW, "__AVR_ATxmega64A1U__", 0x2000, 0x0, 0, 0x11000) 1079 | /* Xmega, 128K < Flash, RAM <= 64K */ 1080 | -AVR_MCU ("avrxmega6", ARCH_AVRXMEGA6, AVR_ISA_NONE, NULL, 0x2000, 0x0, 0x60000) 1081 | -AVR_MCU ("atxmega128a3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega128A3__", 0x2000, 0x0, 0x22000) 1082 | -AVR_MCU ("atxmega128d3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega128D3__", 0x2000, 0x0, 0x22000) 1083 | -AVR_MCU ("atxmega192a3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega192A3__", 0x2000, 0x0, 0x32000) 1084 | -AVR_MCU ("atxmega192d3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega192D3__", 0x2000, 0x0, 0x32000) 1085 | -AVR_MCU ("atxmega256a3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega256A3__", 0x2000, 0x0, 0x42000) 1086 | -AVR_MCU ("atxmega256a3b", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega256A3B__", 0x2000, 0x0, 0x42000) 1087 | -AVR_MCU ("atxmega256a3bu", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega256A3BU__", 0x2000, 0x0, 0x42000) 1088 | -AVR_MCU ("atxmega256d3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega256D3__", 0x2000, 0x0, 0x42000) 1089 | -AVR_MCU ("atxmega128a3u", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega128A3U__", 0x2000, 0x0, 0x22000) 1090 | -AVR_MCU ("atxmega128b1", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega128B1__", 0x2000, 0x0, 0x22000) 1091 | -AVR_MCU ("atxmega128b3", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega128B3__", 0x2000, 0x0, 0x22000) 1092 | -AVR_MCU ("atxmega128c3", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega128C3__", 0x2000, 0x0, 0x22000) 1093 | -AVR_MCU ("atxmega128d4", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega128D4__", 0x2000, 0x0, 0x22000) 1094 | -AVR_MCU ("atxmega192a3u", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega192A3U__", 0x2000, 0x0, 0x32000) 1095 | -AVR_MCU ("atxmega192c3", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega192C3__", 0x2000, 0x0, 0x32000) 1096 | -AVR_MCU ("atxmega256a3u", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega256A3U__", 0x2000, 0x0, 0x42000) 1097 | -AVR_MCU ("atxmega256c3", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega256C3__", 0x2000, 0x0, 0x42000) 1098 | -AVR_MCU ("atxmega384c3", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega384C3__", 0x2000, 0x0, 0x62000) 1099 | -AVR_MCU ("atxmega384d3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega384D3__", 0x2000, 0x0, 0x62000) 1100 | +AVR_MCU ("avrxmega6", ARCH_AVRXMEGA6, AVR_ISA_NONE, NULL, 0x2000, 0x0, 0, 0x60000) 1101 | +AVR_MCU ("atxmega128a3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega128A3__", 0x2000, 0x0, 0, 0x22000) 1102 | +AVR_MCU ("atxmega128d3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega128D3__", 0x2000, 0x0, 0, 0x22000) 1103 | +AVR_MCU ("atxmega192a3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega192A3__", 0x2000, 0x0, 0, 0x32000) 1104 | +AVR_MCU ("atxmega192d3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega192D3__", 0x2000, 0x0, 0, 0x32000) 1105 | +AVR_MCU ("atxmega256a3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega256A3__", 0x2000, 0x0, 0, 0x42000) 1106 | +AVR_MCU ("atxmega256a3b", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega256A3B__", 0x2000, 0x0, 0, 0x42000) 1107 | +AVR_MCU ("atxmega256a3bu", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega256A3BU__", 0x2000, 0x0, 0, 0x42000) 1108 | +AVR_MCU ("atxmega256d3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega256D3__", 0x2000, 0x0, 0, 0x42000) 1109 | +AVR_MCU ("atxmega128a3u", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega128A3U__", 0x2000, 0x0, 0, 0x22000) 1110 | +AVR_MCU ("atxmega128b1", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega128B1__", 0x2000, 0x0, 0, 0x22000) 1111 | +AVR_MCU ("atxmega128b3", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega128B3__", 0x2000, 0x0, 0, 0x22000) 1112 | +AVR_MCU ("atxmega128c3", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega128C3__", 0x2000, 0x0, 0, 0x22000) 1113 | +AVR_MCU ("atxmega128d4", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega128D4__", 0x2000, 0x0, 0, 0x22000) 1114 | +AVR_MCU ("atxmega192a3u", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega192A3U__", 0x2000, 0x0, 0, 0x32000) 1115 | +AVR_MCU ("atxmega192c3", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega192C3__", 0x2000, 0x0, 0, 0x32000) 1116 | +AVR_MCU ("atxmega256a3u", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega256A3U__", 0x2000, 0x0, 0, 0x42000) 1117 | +AVR_MCU ("atxmega256c3", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega256C3__", 0x2000, 0x0, 0, 0x42000) 1118 | +AVR_MCU ("atxmega384c3", ARCH_AVRXMEGA6, AVR_ISA_RMW, "__AVR_ATxmega384C3__", 0x2000, 0x0, 0, 0x62000) 1119 | +AVR_MCU ("atxmega384d3", ARCH_AVRXMEGA6, AVR_ISA_NONE, "__AVR_ATxmega384D3__", 0x2000, 0x0, 0, 0x62000) 1120 | /* Xmega, 128K < Flash, RAM > 64K RAM. */ 1121 | -AVR_MCU ("avrxmega7", ARCH_AVRXMEGA7, AVR_ISA_NONE, NULL, 0x2000, 0x0, 0x22000) 1122 | -AVR_MCU ("atxmega128a1", ARCH_AVRXMEGA7, AVR_ISA_NONE, "__AVR_ATxmega128A1__", 0x2000, 0x0, 0x22000) 1123 | -AVR_MCU ("atxmega128a1u", ARCH_AVRXMEGA7, AVR_ISA_RMW, "__AVR_ATxmega128A1U__", 0x2000, 0x0, 0x22000) 1124 | -AVR_MCU ("atxmega128a4u", ARCH_AVRXMEGA7, AVR_ISA_RMW, "__AVR_ATxmega128A4U__", 0x2000, 0x0, 0x22000) 1125 | +AVR_MCU ("avrxmega7", ARCH_AVRXMEGA7, AVR_ISA_NONE, NULL, 0x2000, 0x0, 0, 0x22000) 1126 | +AVR_MCU ("atxmega128a1", ARCH_AVRXMEGA7, AVR_ISA_NONE, "__AVR_ATxmega128A1__", 0x2000, 0x0, 0, 0x22000) 1127 | +AVR_MCU ("atxmega128a1u", ARCH_AVRXMEGA7, AVR_ISA_RMW, "__AVR_ATxmega128A1U__", 0x2000, 0x0, 0, 0x22000) 1128 | +AVR_MCU ("atxmega128a4u", ARCH_AVRXMEGA7, AVR_ISA_RMW, "__AVR_ATxmega128A4U__", 0x2000, 0x0, 0, 0x22000) 1129 | /* Tiny family */ 1130 | -AVR_MCU ("avrtiny", ARCH_AVRTINY, AVR_ISA_NONE, NULL, 0x0040, 0x0, 0x400) 1131 | -AVR_MCU ("attiny4", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny4__", 0x0040, 0x0, 0x200) 1132 | -AVR_MCU ("attiny5", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny5__", 0x0040, 0x0, 0x200) 1133 | -AVR_MCU ("attiny9", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny9__", 0x0040, 0x0, 0x400) 1134 | -AVR_MCU ("attiny10", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny10__", 0x0040, 0x0, 0x400) 1135 | -AVR_MCU ("attiny20", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny20__", 0x0040, 0x0, 0x800) 1136 | -AVR_MCU ("attiny40", ARCH_AVRTINY, AVR_ISA_NONE, "__AVR_ATtiny40__", 0x0040, 0x0, 0x1000) 1137 | +AVR_MCU ("avrtiny", ARCH_AVRTINY, AVR_ISA_NONE, NULL, 0x0040, 0x0, 0, 0x400) 1138 | +AVR_MCU ("attiny4", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny4__", 0x0040, 0x0, 0, 0x200) 1139 | +AVR_MCU ("attiny5", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny5__", 0x0040, 0x0, 0, 0x200) 1140 | +AVR_MCU ("attiny9", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny9__", 0x0040, 0x0, 0, 0x400) 1141 | +AVR_MCU ("attiny10", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny10__", 0x0040, 0x0, 0, 0x400) 1142 | +AVR_MCU ("attiny20", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny20__", 0x0040, 0x0, 0, 0x800) 1143 | +AVR_MCU ("attiny40", ARCH_AVRTINY, AVR_ISA_NONE, "__AVR_ATtiny40__", 0x0040, 0x0, 0, 0x1000) 1144 | /* Assembler only. */ 1145 | -AVR_MCU ("avr1", ARCH_AVR1, AVR_ISA_NONE, NULL, 0x0060, 0x0, 0x400) 1146 | -AVR_MCU ("at90s1200", ARCH_AVR1, AVR_ISA_NONE, "__AVR_AT90S1200__", 0x0060, 0x0, 0x400) 1147 | -AVR_MCU ("attiny11", ARCH_AVR1, AVR_ISA_NONE, "__AVR_ATtiny11__", 0x0060, 0x0, 0x400) 1148 | -AVR_MCU ("attiny12", ARCH_AVR1, AVR_ISA_NONE, "__AVR_ATtiny12__", 0x0060, 0x0, 0x400) 1149 | -AVR_MCU ("attiny15", ARCH_AVR1, AVR_ISA_NONE, "__AVR_ATtiny15__", 0x0060, 0x0, 0x400) 1150 | -AVR_MCU ("attiny28", ARCH_AVR1, AVR_ISA_NONE, "__AVR_ATtiny28__", 0x0060, 0x0, 0x800) 1151 | +AVR_MCU ("avr1", ARCH_AVR1, AVR_ISA_NONE, NULL, 0x0060, 0x0, 0, 0x400) 1152 | +AVR_MCU ("at90s1200", ARCH_AVR1, AVR_ISA_NONE, "__AVR_AT90S1200__", 0x0060, 0x0, 0, 0x400) 1153 | +AVR_MCU ("attiny11", ARCH_AVR1, AVR_ISA_NONE, "__AVR_ATtiny11__", 0x0060, 0x0, 0, 0x400) 1154 | +AVR_MCU ("attiny12", ARCH_AVR1, AVR_ISA_NONE, "__AVR_ATtiny12__", 0x0060, 0x0, 0, 0x400) 1155 | +AVR_MCU ("attiny15", ARCH_AVR1, AVR_ISA_NONE, "__AVR_ATtiny15__", 0x0060, 0x0, 0, 0x400) 1156 | +AVR_MCU ("attiny28", ARCH_AVR1, AVR_ISA_NONE, "__AVR_ATtiny28__", 0x0060, 0x0, 0, 0x800) 1157 | Only in gcc-7.3.0-patched/gcc/config/avr: avr-mcus.def.orig 1158 | Only in gcc-7.3.0-patched/gcc/config/avr: avr-mcus.def.rej 1159 | Only in gcc-7.3.0-patched/gcc/config/avr: avr.md.orig 1160 | diff -ur gcc/gcc/config/avr/avr.opt gcc-7.3.0-patched/gcc/config/avr/avr.opt 1161 | --- gcc/gcc/config/avr/avr.opt 2017-01-09 22:48:33.107036000 +0100 1162 | +++ gcc-7.3.0-patched/gcc/config/avr/avr.opt 2018-11-29 15:40:15.272300988 +0100 1163 | @@ -30,6 +30,10 @@ 1164 | Target RejectNegative Joined Var(avr_n_flash) UInteger Init(-1) 1165 | Set the number of 64 KiB flash segments. 1166 | 1167 | +mnon-bit-addressable-registers-mask= 1168 | +Target Report Joined Var(avr_deferred_options) Defer 1169 | +Set the 32 bit mask for non bit addressable registers. 1170 | + 1171 | mskip-bug 1172 | Target Report Mask(SKIP_BUG) 1173 | Indicate presence of a processor erratum. 1174 | @@ -44,6 +48,10 @@ 1175 | mlog= 1176 | Target RejectNegative Joined Undocumented Var(avr_log_details) 1177 | 1178 | +mshort-calls 1179 | +Target Report RejectNegative Mask(SHORT_CALLS) 1180 | +Use RJMP / RCALL even though CALL / JMP are available. 1181 | + 1182 | mint8 1183 | Target Report Mask(INT8) 1184 | Use an 8-bit 'int' type. 1185 | Only in gcc-7.3.0-patched/gcc/config/avr: avr.opt.orig 1186 | Only in gcc-7.3.0-patched/gcc/config/avr: avr.opt.rej 1187 | diff -ur gcc/gcc/config/avr/avr-protos.h gcc-7.3.0-patched/gcc/config/avr/avr-protos.h 1188 | --- gcc/gcc/config/avr/avr-protos.h 2017-01-01 13:07:43.905435000 +0100 1189 | +++ gcc-7.3.0-patched/gcc/config/avr/avr-protos.h 2018-11-29 15:40:15.272300988 +0100 1190 | @@ -183,3 +183,4 @@ 1191 | } avr_log_t; 1192 | 1193 | extern avr_log_t avr_log; 1194 | +extern unsigned long avr_non_bit_addressable_registers_mask; 1195 | Only in gcc-7.3.0-patched/gcc/config/avr: avr-protos.h.orig 1196 | Only in gcc-7.3.0-patched/gcc/config/avr: driver-avr.c.rej 1197 | diff -ur gcc/gcc/config/avr/gen-avr-mmcu-specs.c gcc-7.3.0-patched/gcc/config/avr/gen-avr-mmcu-specs.c 1198 | --- gcc/gcc/config/avr/gen-avr-mmcu-specs.c 2017-01-01 13:07:43.905435000 +0100 1199 | +++ gcc-7.3.0-patched/gcc/config/avr/gen-avr-mmcu-specs.c 2018-12-03 11:07:38.331430937 +0100 1200 | @@ -113,6 +113,7 @@ 1201 | print_mcu (const avr_mcu_t *mcu) 1202 | { 1203 | const char *sp8_spec; 1204 | + const char *rcall_spec; 1205 | const avr_mcu_t *arch_mcu; 1206 | const avr_arch_t *arch; 1207 | enum avr_arch_id arch_id = mcu->arch_id; 1208 | @@ -134,6 +135,7 @@ 1209 | bool errata_skip = 0 != (mcu->dev_attribute & AVR_ERRATA_SKIP); 1210 | bool rmw = 0 != (mcu->dev_attribute & AVR_ISA_RMW); 1211 | bool sp8 = 0 != (mcu->dev_attribute & AVR_SHORT_SP); 1212 | + bool rcall = (mcu->dev_attribute & AVR_ISA_RCALL); 1213 | bool is_arch = NULL == mcu->macro; 1214 | bool is_device = ! is_arch; 1215 | 1216 | @@ -150,13 +152,25 @@ 1217 | sp8_spec = sp8 ? "-msp8" :"%name); 1236 | else 1237 | - fprintf (f, "device %s (core %s, %d-bit SP)\n", 1238 | - mcu->name, arch->name, sp8 ? 8 : 16); 1239 | + fprintf (f, "device %s (core %s, %d-bit SP%s)\n", 1240 | + mcu->name, arch->name, sp8 ? 8 : 16, rcall ? ", short-calls" : ""); 1241 | fprintf (f, "%s\n", header); 1242 | 1243 | if (is_device) 1244 | @@ -196,6 +210,15 @@ 1245 | ? "\t%{!mno-absdata: -mabsdata}" 1246 | : "\t%{mabsdata}"); 1247 | 1248 | + if (mcu->non_bit_addressable_registers_mask) 1249 | + fprintf (f, "*cc1_non_bit_addressable_registers_mask:\n" 1250 | + "\t-mnon-bit-addressable-registers-mask=%#x\n\n", 1251 | + mcu->non_bit_addressable_registers_mask); 1252 | + 1253 | + fprintf (f, "*cc1_absdata:\n%s\n\n", absdata 1254 | + ? "\t%{!mno-absdata: -mabsdata}" 1255 | + : "\t%{mabsdata}"); 1256 | + 1257 | // avr-gcc specific specs for assembling / the assembler. 1258 | 1259 | fprintf (f, "*asm_arch:\n\t-mmcu=%s\n\n", arch->name); 1260 | @@ -255,6 +278,7 @@ 1261 | { 1262 | fprintf (f, "*self_spec:\n"); 1263 | fprintf (f, "\t%%{!mmcu=avr*: %%name); 1264 | + fprintf (f, "%s ", rcall_spec); 1265 | fprintf (f, "%s\n\n", sp8_spec); 1266 | 1267 | #if defined (WITH_AVRLIBC) 1268 | Only in gcc-7.3.0-patched/gcc/config/avr: gen-avr-mmcu-specs.c.orig 1269 | Only in gcc-7.3.0-patched/gcc/config/avr: gen-avr-mmcu-specs.c.rej 1270 | diff -ur gcc/gcc/config/avr/genmultilib.awk gcc-7.3.0-patched/gcc/config/avr/genmultilib.awk 1271 | --- gcc/gcc/config/avr/genmultilib.awk 2017-01-01 13:07:43.905435000 +0100 1272 | +++ gcc-7.3.0-patched/gcc/config/avr/genmultilib.awk 2018-11-29 15:40:16.878967668 +0100 1273 | @@ -22,23 +22,31 @@ 1274 | # Representation that is understood by GCC's multilib Machinery. 1275 | # 1276 | # The Script works as a Filter from STDIN to STDOUT. 1277 | -# 1278 | -# FORMAT = "Makefile": Generate Makefile Snipet that sets some 1279 | -# MULTILIB_* Variables as needed. 1280 | +# It generates a Makefile Snippet that sets some 1281 | +# MULTILIB_* Variables as needed. 1282 | # 1283 | ################################################################## 1284 | 1285 | BEGIN { 1286 | FS ="[(, \t]+" 1287 | option[""] = "" 1288 | - tiny_stack[""] = 1 1289 | comment = 1 1290 | - n_mcu = 0 1291 | - n_cores = 0 1292 | 1293 | - mtiny[0] = "" 1294 | - mtiny[1] = "tiny-stack" 1295 | - option["tiny-stack"] = "msp8" 1296 | + dir_tiny = "tiny-stack" 1297 | + opt_tiny = "msp8" 1298 | + 1299 | + dir_rcall = "short-calls" 1300 | + opt_rcall = "mshort-calls" 1301 | + 1302 | + # awk Variable Makefile Variable 1303 | + # ------------------------------------------ 1304 | + # m_options <-> MULTILIB_OPTIONS 1305 | + # m_dirnames <-> MULTILIB_DIRNAMES 1306 | + # m_required <-> MULTILIB_REQUIRED 1307 | + m_sep = "" 1308 | + m_options = "\nMULTILIB_OPTIONS = " 1309 | + m_dirnames = "\nMULTILIB_DIRNAMES =" 1310 | + m_required = "\nMULTILIB_REQUIRED =" 1311 | } 1312 | 1313 | ################################################################## 1314 | @@ -51,14 +59,11 @@ 1315 | next 1316 | else if (comment == 1) 1317 | { 1318 | - if (FORMAT == "Makefile") 1319 | - { 1320 | - print "# Auto-generated Makefile Snip" 1321 | - print "# Generated by : ./gcc/config/avr/genmultilib.awk" 1322 | - print "# Generated from : ./gcc/config/avr/avr-mcus.def" 1323 | - print "# Used by : tmake_file from Makefile and genmultilib" 1324 | - print "" 1325 | - } 1326 | + print "# Auto-generated Makefile Snip" 1327 | + print "# Generated by : ./gcc/config/avr/genmultilib.awk" 1328 | + print "# Generated from : ./gcc/config/avr/avr-mcus.def" 1329 | + print "# Used by : tmake_file from Makefile and genmultilib" 1330 | + print "" 1331 | } 1332 | 1333 | comment = 2; 1334 | @@ -74,12 +79,10 @@ 1335 | } 1336 | 1337 | ################################################################## 1338 | -# Run over all AVR_MCU Lines and gather Information: 1339 | -# cores[] : Enumerates the Cores (avr2, avr25, ...) 1340 | -# mcu[] : Enumerates the Devices 1341 | -# tiny_stack[]: Maps Core/Device to 0 (2-byte SP) or 1 (1-byte SP) 1342 | -# option[] : Maps Core/Device to the mmcu= option to get it 1343 | -# toCore[] : Maps Device to its Core 1344 | +# Run over all AVR_MCU Lines. If we encounter a required multilib 1345 | +# variant, add according combination of options to m_required, 1346 | +# but onyl once. Add encountered cores to m_dirnames and 1347 | +# according -mmcu= options to m_options. 1348 | ################################################################## 1349 | 1350 | /^AVR_MCU/ { 1351 | @@ -94,11 +97,12 @@ 1352 | if (core == "avr1") 1353 | next 1354 | 1355 | - cores[n_cores] = core 1356 | - n_cores++ 1357 | - tiny_stack[core] = 0 1358 | option[core] = "mmcu=" core 1359 | 1360 | + m_options = m_options m_sep option[core] 1361 | + m_dirnames = m_dirnames " " core 1362 | + m_sep = "/" 1363 | + 1364 | next 1365 | } 1366 | 1367 | @@ -106,116 +110,42 @@ 1368 | if (core == "avr1") 1369 | next 1370 | 1371 | + opts = option[core] 1372 | + 1373 | # split device specific feature list 1374 | n = split($4,dev_attribute,"|") 1375 | 1376 | - # set tiny_stack false by default 1377 | - tiny_stack[name] = 0 1378 | for (i=1; i <= n; i++) 1379 | - if (dev_attribute[i] == "AVR_SHORT_SP") { 1380 | - tiny_stack[name] = 1 1381 | - break 1382 | - } 1383 | - 1384 | - mcu[n_mcu] = name 1385 | - n_mcu++ 1386 | - option[name] = "mmcu=" name 1387 | - toCore[name] = core 1388 | + { 1389 | + if (dev_attribute[i] == "AVR_SHORT_SP") 1390 | + opts = opts "/" opt_tiny 1391 | + if (dev_attribute[i] == "AVR_ISA_RCALL") 1392 | + opts = opts "/" opt_rcall 1393 | + } 1394 | 1395 | - if (tiny_stack[name] == 1) 1396 | - tiny_stack[core] = 1 1397 | + if (!have[opts]) 1398 | + { 1399 | + have[opts] = 1 1400 | + # Some special handling for the default mmcu: Remove a 1401 | + # leading "mmcu=avr2/" in order not to confuse genmultilib. 1402 | + opts = gensub (/mmcu=avr2\//, "", 1, opts) 1403 | + if (opts != "mmcu=avr2") 1404 | + m_required = m_required " \\\n\t" opts 1405 | + } 1406 | } 1407 | 1408 | ################################################################## 1409 | # 1410 | -# We gathered all the Information, now build/output the following: 1411 | -# 1412 | -# awk Variable target Variable FORMAT 1413 | -# ----------------------------------------------------------- 1414 | -# m_options <-> MULTILIB_OPTIONS Makefile 1415 | -# m_dirnames <-> MULTILIB_DIRNAMES " 1416 | -# m_exceptions <-> MULTILIB_EXCEPTIONS " 1417 | -# 1418 | ################################################################## 1419 | 1420 | END { 1421 | - m_options = "\nMULTILIB_OPTIONS = " 1422 | - m_dirnames = "\nMULTILIB_DIRNAMES =" 1423 | - m_exceptions = "\nMULTILIB_EXCEPTIONS =" 1424 | - 1425 | - ############################################################## 1426 | - # Compose MULTILIB_OPTIONS. This represents the Cross-Product 1427 | - # (avr2, avr25, ...) x msp8 1428 | - 1429 | - sep = "" 1430 | - for (c = 0; c < n_cores; c++) 1431 | - { 1432 | - m_options = m_options sep option[cores[c]] 1433 | - sep = "/" 1434 | - } 1435 | - 1436 | - # The ... x msp8 1437 | - m_options = m_options " " option[mtiny[1]] 1438 | - 1439 | - ############################################################## 1440 | - # Map Device to its multilib 1441 | - 1442 | - for (t = 0; t < n_mcu; t++) 1443 | - { 1444 | - core = toCore[mcu[t]] 1445 | - 1446 | - line = option[core] ":" option[mcu[t]] 1447 | - gsub ("=", "?", line) 1448 | - gsub (":", "=", line) 1449 | - } 1450 | - 1451 | - #################################################################### 1452 | - # Compose MULTILIB_DIRNAMES and MULTILIB_EXEPTIONS 1453 | - 1454 | - n_mtiny = 2 1455 | - for (t = 0; t < n_mtiny; t++) 1456 | - for (c = -1; c < n_cores; c++) 1457 | - { 1458 | - if (c == -1) 1459 | - core = "" 1460 | - else 1461 | - core = cores[c] 1462 | - 1463 | - # The Directory Name for this multilib 1464 | - 1465 | - if (core != "" && mtiny[t] != "") 1466 | - { 1467 | - mdir = core "/" mtiny[t] 1468 | - mopt = option[core] "/" option[mtiny[t]] 1469 | - } 1470 | - else 1471 | - { 1472 | - mdir = core mtiny[t] 1473 | - mopt = option[core] option[mtiny[t]] 1474 | - } 1475 | - 1476 | - if (core != "" && tiny_stack[core] == 0 && mtiny[t] != "") 1477 | - { 1478 | - # There's not a single SP = 8 Devices for this Core: 1479 | - # Don't build respective multilib 1480 | - m_exceptions = m_exceptions " \\\n\t" mopt 1481 | - continue 1482 | - } 1483 | - 1484 | - if (core != "avr2" || mtiny[t] == "") 1485 | - m_dirnames = m_dirnames " " mdir 1486 | - } 1487 | - 1488 | ############################################################ 1489 | # Output that Stuff 1490 | ############################################################ 1491 | 1492 | - if (FORMAT == "Makefile") 1493 | - { 1494 | - # Intended Target: ./gcc/config/avr/t-multilib 1495 | + # Intended Target: ./gcc/config/avr/t-multilib 1496 | 1497 | - print m_options 1498 | - print m_dirnames 1499 | - print m_exceptions 1500 | - } 1501 | + print m_options " " opt_tiny " " opt_rcall 1502 | + print m_dirnames " " dir_tiny " " dir_rcall 1503 | + print m_required 1504 | } 1505 | diff -ur gcc/gcc/config/avr/predicates.md gcc-7.3.0-patched/gcc/config/avr/predicates.md 1506 | --- gcc/gcc/config/avr/predicates.md 2017-01-01 13:07:43.905435000 +0100 1507 | +++ gcc-7.3.0-patched/gcc/config/avr/predicates.md 2018-11-29 15:40:16.878967668 +0100 1508 | @@ -42,11 +42,13 @@ 1509 | (and (match_code "reg") 1510 | (match_test "REGNO (op) == REG_SP"))) 1511 | 1512 | -;; Return true if OP is a valid address for lower half of I/O space. 1513 | +;; Return true if OP is a valid address for lower half of I/O space 1514 | +;; and it is bit addressable 1515 | (define_special_predicate "low_io_address_operand" 1516 | (ior (and (match_code "const_int") 1517 | (match_test "IN_RANGE (INTVAL (op) - avr_arch->sfr_offset, 1518 | - 0, 0x1F)")) 1519 | + 0, 0x1F) && 1520 | + (((1 << (INTVAL (op) - avr_arch->sfr_offset)) & avr_non_bit_addressable_registers_mask) == 0)")) 1521 | (and (match_code "symbol_ref") 1522 | (match_test "SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_IO_LOW")))) 1523 | 1524 | Only in gcc-7.3.0-patched/gcc/config/avr: specs.h.orig 1525 | Only in gcc-7.3.0-patched/gcc/config/avr: specs.h.rej 1526 | diff -ur gcc/gcc/config/avr/t-avr gcc-7.3.0-patched/gcc/config/avr/t-avr 1527 | --- gcc/gcc/config/avr/t-avr 2017-01-01 13:07:43.905435000 +0100 1528 | +++ gcc-7.3.0-patched/gcc/config/avr/t-avr 2018-11-29 15:40:16.878967668 +0100 1529 | @@ -89,14 +89,13 @@ 1530 | $(INSTALL_DATA) $${file} $(DESTDIR)$(libsubdir)/$${file}; \ 1531 | done 1532 | 1533 | -# Map -mmcu= to the right multilib variant 1534 | +# Get multilib layout 1535 | # MULTILIB_OPTIONS 1536 | # MULTILIB_DIRNAMES 1537 | -# MULTILIB_EXCEPTIONS 1538 | -# MULTILIB_MATCHES 1539 | +# MULTILIB_REQUIRED 1540 | 1541 | s-mlib: $(srcdir)/config/avr/t-multilib 1542 | 1543 | $(srcdir)/config/avr/t-multilib: $(srcdir)/config/avr/genmultilib.awk \ 1544 | $(AVR_MCUS) 1545 | - $(AWK) -f $< -v FORMAT=Makefile $< $(AVR_MCUS) > $@ 1546 | + $(AWK) -f $< $< $(AVR_MCUS) > $@ 1547 | Only in gcc-7.3.0-patched/gcc/config/avr: t-avr.orig 1548 | diff -ur gcc/gcc/config/avr/specs.h gcc-7.3.0-patched/gcc/config/avr/specs.h 1549 | --- gcc/gcc/config/avr/specs.h 2017-01-01 13:07:43.905435000 +0100 1550 | +++ gcc-7.3.0-patched/gcc/config/avr/specs.h 2018-12-03 12:12:09.734746759 +0100 1551 | @@ -35,6 +35,7 @@ 1552 | "%(cc1_n_flash) " \ 1553 | "%(cc1_errata_skip) " \ 1554 | "%(cc1_rmw) " \ 1555 | + "%(cc1_non_bit_addressable_registers_mask) " \ 1556 | "%(cc1_absdata) " 1557 | 1558 | #undef CC1PLUS_SPEC 1559 | diff -ur gcc/gcc/config/avr/t-multilib gcc-7.3.0-patched/gcc/config/avr/t-multilib 1560 | --- gcc/gcc/config/avr/t-multilib 2017-01-01 13:07:43.905435000 +0100 1561 | +++ gcc-7.3.0-patched/gcc/config/avr/t-multilib 2018-11-29 16:08:58.825647392 +0100 1562 | @@ -21,21 +21,24 @@ 1563 | # along with GCC; see the file COPYING3. If not see 1564 | # . 1565 | 1566 | -MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6/mmcu=avrxmega2/mmcu=avrxmega4/mmcu=avrxmega5/mmcu=avrxmega6/mmcu=avrxmega7/mmcu=avrtiny msp8 1567 | +MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6/mmcu=avrxmega2/mmcu=avrxmega3/mmcu=avrxmega4/mmcu=avrxmega5/mmcu=avrxmega6/mmcu=avrxmega7/mmcu=avrtiny msp8 mshort-calls 1568 | 1569 | -MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega2 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny tiny-stack avr25/tiny-stack 1570 | +MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny tiny-stack short-calls 1571 | 1572 | -MULTILIB_EXCEPTIONS = \ 1573 | - mmcu=avr3/msp8 \ 1574 | - mmcu=avr31/msp8 \ 1575 | - mmcu=avr35/msp8 \ 1576 | - mmcu=avr4/msp8 \ 1577 | - mmcu=avr5/msp8 \ 1578 | - mmcu=avr51/msp8 \ 1579 | - mmcu=avr6/msp8 \ 1580 | - mmcu=avrxmega2/msp8 \ 1581 | - mmcu=avrxmega4/msp8 \ 1582 | - mmcu=avrxmega5/msp8 \ 1583 | - mmcu=avrxmega6/msp8 \ 1584 | - mmcu=avrxmega7/msp8 \ 1585 | - mmcu=avrtiny/msp8 1586 | +MULTILIB_REQUIRED = \ 1587 | + msp8 \ 1588 | + mmcu=avr25 \ 1589 | + mmcu=avr25/msp8 \ 1590 | + mmcu=avr3 \ 1591 | + mmcu=avr31 \ 1592 | + mmcu=avr35 \ 1593 | + mmcu=avr4 \ 1594 | + mmcu=avr5 \ 1595 | + mmcu=avr51 \ 1596 | + mmcu=avr6 \ 1597 | + mmcu=avrxmega2 \ 1598 | + mmcu=avrxmega3/mshort-calls \ 1599 | + mmcu=avrxmega3 \ 1600 | + mmcu=avrxmega4 \ 1601 | + mmcu=avrxmega5 \ 1602 | + mmcu=avrxmega6 \ 1603 | + mmcu=avrxmega7 \ 1604 | + mmcu=avrtiny 1605 | diff -ur gcc/gcc/configure gcc-7.3.0-patched/gcc/configure 1606 | --- gcc/gcc/configure 2017-11-21 10:31:12.135035000 +0100 1607 | +++ gcc-7.3.0-patched/gcc/configure 2018-11-29 15:40:16.885634334 +0100 1608 | @@ -29085,6 +29085,61 @@ 1609 | || ( test $glibc_version_major -eq 2 && test $glibc_version_minor -ge 23 ); then : 1610 | gcc_cv_libc_provides_hwcap_in_tcb=yes 1611 | fi 1612 | + 1613 | + # Check how default linker description file implements .rodata for 1614 | + # avrxmega3 (PR21472). avr-gcc assumes .rodata is *not* loaded to 1615 | + # RAM so avr-gcc skips __do_copy_data for .rodata objects. 1616 | + { $as_echo "$as_me:${as_lineno-$LINENO}: checking binutils for avrxmega3 .rodata support" >&5 1617 | +$as_echo_n "checking binutils for avrxmega3 .rodata support... " >&6; } 1618 | + cat > conftest.s <&5 1628 | + (eval $ac_try) 2>&5 1629 | + ac_status=$? 1630 | + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 1631 | + test $ac_status = 0; }; } 1632 | + { ac_try='$gcc_cv_ld -mavrxmega3 conftest.o -o conftest.elf' 1633 | + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 1634 | + (eval $ac_try) 2>&5 1635 | + ac_status=$? 1636 | + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 1637 | + test $ac_status = 0; }; } 1638 | + { ac_try='$gcc_cv_nm conftest.elf > conftest.nm' 1639 | + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 1640 | + (eval $ac_try) 2>&5 1641 | + ac_status=$? 1642 | + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 1643 | + test $ac_status = 0; }; } 1644 | + if test -f conftest.nm 1645 | + then 1646 | + if grep ' R xxvaryy' conftest.nm > /dev/null; then 1647 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 1648 | +$as_echo "yes" >&6; } 1649 | + rm -f conftest.s conftest.o conftest.elf conftest.nm 1650 | + else 1651 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no: avrxmega3 .rodata located in RAM" >&5 1652 | +$as_echo "no: avrxmega3 .rodata located in RAM" >&6; } 1653 | + echo "$as_me: nm output was" >&5 1654 | + cat conftest.nm >&5 1655 | + rm -f conftest.s conftest.o conftest.elf conftest.nm 1656 | + avr_ld_ver="`$gcc_cv_ld -v | sed -e 's:^.* ::'`" 1657 | + as_fn_error "support for avrxmega3 needs Binutils 2.29 or higher (have $avr_ld_ver)" "$LINENO" 5 1658 | + fi 1659 | + else 1660 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: test failed" >&5 1661 | +$as_echo "test failed" >&6; } 1662 | + echo "$as_me: failed program was" >&5 1663 | + cat conftest.s >&5 1664 | + rm -f conftest.s conftest.o conftest.elf 1665 | + as_fn_error "see \`config.log' for details" "$LINENO" 5 1666 | + fi 1667 | ;; 1668 | esac 1669 | if test x$gcc_cv_libc_provides_hwcap_in_tcb = xyes; then 1670 | diff -ur gcc/gcc/configure.ac gcc-7.3.0-patched/gcc/configure.ac 1671 | --- gcc/gcc/configure.ac 2017-11-21 10:31:12.135035000 +0100 1672 | +++ gcc-7.3.0-patched/gcc/configure.ac 2018-11-29 15:40:16.885634334 +0100 1673 | @@ -3818,6 +3818,42 @@ 1674 | [-mrmw], [.text],, 1675 | [AC_DEFINE(HAVE_AS_AVR_MRMW_OPTION, 1, 1676 | [Define if your avr assembler supports -mrmw option.])]) 1677 | + 1678 | + # Check how default linker description file implements .rodata for 1679 | + # avrxmega3 (PR21472). avr-gcc assumes .rodata is *not* loaded to 1680 | + # RAM so avr-gcc skips __do_copy_data for .rodata objects. 1681 | + AC_MSG_CHECKING(binutils for avrxmega3 .rodata support) 1682 | + cat > conftest.s < conftest.nm]) 1693 | + if test -f conftest.nm 1694 | + then 1695 | + if grep ' R xxvaryy' conftest.nm > /dev/null; then 1696 | + AC_MSG_RESULT(yes) 1697 | + rm -f conftest.s conftest.o conftest.elf conftest.nm 1698 | + else 1699 | + AC_MSG_RESULT(no: avrxmega3 .rodata located in RAM) 1700 | + echo "$as_me: nm output was" >&AS_MESSAGE_LOG_FD 1701 | + cat conftest.nm >&AS_MESSAGE_LOG_FD 1702 | + rm -f conftest.s conftest.o conftest.elf conftest.nm 1703 | + avr_ld_ver="`$gcc_cv_ld -v | sed -e 's:^.* ::'`" 1704 | + AC_MSG_ERROR([[support for avrxmega3 needs Binutils 2.29 or higher (have $avr_ld_ver)]]) 1705 | + fi 1706 | + else 1707 | + AC_MSG_RESULT(test failed) 1708 | + echo "$as_me: failed program was" >&AS_MESSAGE_LOG_FD 1709 | + cat conftest.s >&AS_MESSAGE_LOG_FD 1710 | + rm -f conftest.s conftest.o conftest.elf 1711 | + AC_MSG_ERROR([[see `config.log' for details]]) 1712 | + fi 1713 | ;; 1714 | 1715 | cris-*-*) 1716 | Only in gcc-7.3.0-patched/gcc: configure.ac.orig 1717 | Only in gcc-7.3.0-patched/gcc: configure.orig 1718 | Only in gcc-7.3.0-patched/gcc/doc: extend.texi.orig 1719 | Only in gcc-7.3.0-patched/gcc/doc: extend.texi.rej 1720 | diff -ur gcc/gcc/doc/invoke.texi gcc-7.3.0-patched/gcc/doc/invoke.texi 1721 | --- gcc/gcc/doc/invoke.texi 2018-01-16 12:22:01.161048000 +0100 1722 | +++ gcc-7.3.0-patched/gcc/doc/invoke.texi 2018-12-03 11:09:38.708097088 +0100 1723 | @@ -15542,6 +15542,15 @@ 1724 | Assume that the device supports the Read-Modify-Write 1725 | instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}. 1726 | 1727 | +@item -mshort-calls 1728 | +@opindex mshort-calls 1729 | + 1730 | +Assume that @code{RJMP} and @code{RCALL} can target the whole 1731 | +program memory. 1732 | + 1733 | +This option is used internally for multilib selection. It is 1734 | +not an optimization option, and you don't need to set it by hand. 1735 | + 1736 | @item -msp8 1737 | @opindex msp8 1738 | Treat the stack pointer register as an 8-bit register, 1739 | @@ -15802,10 +15811,12 @@ 1740 | 1741 | respectively and 1742 | 1743 | -@code{100}, @code{102}, @code{104}, 1744 | +@code{100}, 1745 | +@code{102}, @code{103}, @code{104}, 1746 | @code{105}, @code{106}, @code{107} 1747 | 1748 | -for @var{mcu}=@code{avrtiny}, @code{avrxmega2}, @code{avrxmega4}, 1749 | +for @var{mcu}=@code{avrtiny}, 1750 | +@code{avrxmega2}, @code{avrxmega3}, @code{avrxmega4}, 1751 | @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively. 1752 | If @var{mcu} specifies a device, this built-in macro is set 1753 | accordingly. For example, with @option{-mmcu=atmega8} the macro is 1754 | @@ -15857,7 +15868,7 @@ 1755 | 1756 | @item __AVR_HAVE_JMP_CALL__ 1757 | The device has the @code{JMP} and @code{CALL} instructions. 1758 | -This is the case for devices with at least 16@tie{}KiB of program 1759 | +This is the case for devices with more than 8@tie{}KiB of program 1760 | memory. 1761 | 1762 | @item __AVR_HAVE_EIJMP_EICALL__ 1763 | @@ -15914,6 +15925,21 @@ 1764 | to be subtracted from the RAM address in order to get the 1765 | respective I/O@tie{}address. 1766 | 1767 | +@item __AVR_SHORT_CALLS__ 1768 | +The @option{-mshort-calls} command line option is set. 1769 | + 1770 | +@item __AVR_PM_BASE_ADDRESS__=@var{addr} 1771 | +Some devices support reading from flash memory by means of @code{LD*} 1772 | +instructions. The flash memory is seen in the data address space 1773 | +at an offset of @code{__AVR_PM_BASE_ADDRESS__}. If this macro 1774 | +is not defined, this feature is not available. If defined, 1775 | +the address space is linear and there is no need to put 1776 | +@code{.rodata} into RAM. This is handled by the default linker 1777 | +description file, and is currently available for 1778 | +@code{avrtiny} and @code{avrxmega3}. Even more convenient, 1779 | +there is no need to use address spaces like @code{__flash} or 1780 | +features like attribute @code{progmem} and @code{pgm_read_*}. 1781 | + 1782 | @item __WITH_AVRLIBC__ 1783 | The compiler is configured to be used together with AVR-Libc. 1784 | See the @option{--with-avrlibc} configure option. 1785 | Only in gcc-7.3.0-patched/gcc/doc: invoke.texi.orig 1786 | diff -ur gcc/gcc/ira.c gcc-7.3.0-patched/gcc/ira.c 1787 | --- gcc/gcc/ira.c 2017-10-18 23:13:16.833810000 +0200 1788 | +++ gcc-7.3.0-patched/gcc/ira.c 2018-11-29 15:40:16.902301000 +0100 1789 | @@ -4889,7 +4889,10 @@ 1790 | bitmap_head need_new, reachable; 1791 | vec queue; 1792 | 1793 | - if (!SHRINK_WRAPPING_ENABLED) 1794 | + /* Restore 4.9 behavior of splitting live range even if target does 1795 | + not have simple_return. This helps fix code size increase for the 1796 | + avr target - see AVRTC-804 */ 1797 | + if (!flag_shrink_wrap) 1798 | return false; 1799 | 1800 | bitmap_initialize (&need_new, 0); 1801 | Only in gcc-7.3.0-patched/gcc: ira.c.orig 1802 | Only in gcc-7.3.0-patched/gcc: reload1.c.rej 1803 | Only in gcc-7.3.0-patched/gcc: reload.c.rej 1804 | diff -ur gcc/gcc/testsuite/gcc.c-torture/compile/limits-externdecl.c gcc-7.3.0-patched/gcc/testsuite/gcc.c-torture/compile/limits-externdecl.c 1805 | --- gcc/gcc/testsuite/gcc.c-torture/compile/limits-externdecl.c 2015-08-21 15:13:42.953203000 +0200 1806 | +++ gcc-7.3.0-patched/gcc/testsuite/gcc.c-torture/compile/limits-externdecl.c 2018-11-29 15:40:20.125634357 +0100 1807 | @@ -55,4 +55,4 @@ 1808 | REFERENCE references[] = { 1809 | LIM5 (X) 1810 | 0 1811 | -}; 1812 | +}; /* { dg-error "size of array is too large" "" { target avr-*-* } } */ 1813 | Only in gcc-7.3.0-patched/gcc/testsuite/gcc.dg: stack-usage-1.c.rej 1814 | Only in gcc-7.3.0-patched/gcc/testsuite/gcc.target/avr/torture: builtins-error.c.rej 1815 | diff -ur gcc/gcc/testsuite/lib/target-supports.exp gcc-7.3.0-patched/gcc/testsuite/lib/target-supports.exp 1816 | --- gcc/gcc/testsuite/lib/target-supports.exp 2017-11-21 10:31:12.135035000 +0100 1817 | +++ gcc-7.3.0-patched/gcc/testsuite/lib/target-supports.exp 2018-11-29 15:40:24.152301052 +0100 1818 | @@ -7948,6 +7948,24 @@ 1819 | } 1820 | } 1821 | 1822 | + 1823 | +# Return 1 if this is a reduced AVR Tiny core. Such cores have different 1824 | +# register set, instruction set, addressing capabilities and ABI. 1825 | + 1826 | +proc check_effective_target_avr_tiny { } { 1827 | + if { [istarget avr*-*-*] } { 1828 | + return [check_no_compiler_messages avr_tiny object { 1829 | + #ifdef __AVR_TINY__ 1830 | + int dummy; 1831 | + #else 1832 | + #error target not a reduced AVR Tiny core 1833 | + #endif 1834 | + }] 1835 | + } else { 1836 | + return 0 1837 | + } 1838 | +} 1839 | + 1840 | # Return 1 if is available with all the standard IEEE 1841 | # exceptions and floating-point exceptions are raised by arithmetic 1842 | # operations. (If the target requires special options for "inexact" 1843 | Only in gcc-7.3.0-patched/gcc/testsuite/lib: target-supports.exp.orig 1844 | diff -ur gcc/gcc/tree.h gcc-7.3.0-patched/gcc/tree.h 1845 | --- gcc/gcc/tree.h 2017-11-29 23:13:34.210836000 +0100 1846 | +++ gcc-7.3.0-patched/gcc/tree.h 2018-11-29 15:40:24.152301052 +0100 1847 | @@ -21,6 +21,7 @@ 1848 | #define GCC_TREE_H 1849 | 1850 | #include "tree-core.h" 1851 | +#include "machmode.h" 1852 | 1853 | /* Convert a target-independent built-in function code to a combined_fn. */ 1854 | 1855 | Only in gcc/gmp: gmp-5.0.2 1856 | Only in gcc/mpc: mpc-0.9 1857 | Only in gcc/mpfr: mpfr-3.1.0 1858 | -------------------------------------------------------------------------------- /avr-gdb-patches/1000-gdb-python-3-7.patch: -------------------------------------------------------------------------------- 1 | diff --git a/gdb/python/python.c b/gdb/python/python.c 2 | index 4f88b0e26b..c125f496e6 100644 3 | --- a/gdb/python/python.c 4 | +++ b/gdb/python/python.c 5 | @@ -1622,6 +1622,17 @@ finalize_python (void *ignore) 6 | } 7 | #endif 8 | 9 | +#ifdef IS_PY3K 10 | +/* This is called via the PyImport_AppendInittab mechanism called 11 | + during initialization, to make the built-in _gdb module known to 12 | + Python. */ 13 | +PyMODINIT_FUNC 14 | +init__gdb_module (void) 15 | +{ 16 | + return PyModule_Create (&GdbModuleDef); 17 | +} 18 | +#endif 19 | + 20 | /* Provide a prototype to silence -Wmissing-prototypes. */ 21 | extern initialize_file_ftype _initialize_python; 22 | 23 | @@ -1743,6 +1754,9 @@ message == an error message without a stack will be printed."), 24 | remain alive for the duration of the program's execution, so 25 | it is not freed after this call. */ 26 | Py_SetProgramName (progname_copy); 27 | + 28 | + /* Define _gdb as a built-in module. */ 29 | + PyImport_AppendInittab ("_gdb", init__gdb_module); 30 | #else 31 | Py_SetProgramName (progname); 32 | #endif 33 | @@ -1752,9 +1766,7 @@ message == an error message without a stack will be printed."), 34 | PyEval_InitThreads (); 35 | 36 | #ifdef IS_PY3K 37 | - gdb_module = PyModule_Create (&GdbModuleDef); 38 | - /* Add _gdb module to the list of known built-in modules. */ 39 | - _PyImport_FixupBuiltin (gdb_module, "_gdb"); 40 | + gdb_module = PyImport_ImportModule ("_gdb"); 41 | #else 42 | gdb_module = Py_InitModule ("_gdb", python_GdbMethods); 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /avr-libc-patches/01-arduino-malloc_margin.patch: -------------------------------------------------------------------------------- 1 | --- a/libc/stdlib/malloc.c 2014-02-21 17:03:40.606098680 +0100 2 | +++ b/libc/stdlib/malloc.c 2014-02-21 17:03:51.946098314 +0100 3 | @@ -56,7 +56,7 @@ 4 | 5 | /* May be changed by the user only before the first malloc() call. */ 6 | 7 | -size_t __malloc_margin = 32; 8 | +size_t __malloc_margin = 128; 9 | char *__malloc_heap_start = &__heap_start; 10 | char *__malloc_heap_end = &__heap_end; 11 | 12 | -------------------------------------------------------------------------------- /avr-libc-patches/02-power.patch: -------------------------------------------------------------------------------- 1 | --- a/include/avr/power.h 2020-05-26 14:04:10.000000000 +0200 2 | +++ b/include/avr/power.h 2020-05-26 11:29:38.153645260 +0200 3 | @@ -689,6 +689,11 @@ 4 | #define power_spi_disable() (PRR0 |= (uint8_t)(1 << PRSPI)) 5 | #endif 6 | 7 | +#if defined(__AVR_HAVE_PRR0_PRSPI0) 8 | +#define power_spi_enable() (PRR0 &= (uint8_t)~(1 << PRSPI0)) 9 | +#define power_spi_disable() (PRR0 |= (uint8_t)(1 << PRSPI0)) 10 | +#endif 11 | + 12 | #if defined(__AVR_HAVE_PRR0_PRT0) 13 | #define power_timer0_enable() (PRR0 &= (uint8_t)~(1 << PRT0)) 14 | #define power_timer0_disable() (PRR0 |= (uint8_t)(1 << PRT0)) 15 | @@ -734,6 +739,11 @@ 16 | #define power_twi_disable() (PRR0 |= (uint8_t)(1 << PRTWI)) 17 | #endif 18 | 19 | +#if defined(__AVR_HAVE_PRR0_PRTWI0) 20 | +#define power_twi_enable() (PRR0 &= (uint8_t)~(1 << PRTWI0)) 21 | +#define power_twi_disable() (PRR0 |= (uint8_t)(1 << PRTWI0)) 22 | +#endif 23 | + 24 | #if defined(__AVR_HAVE_PRR0_PRTWI1) 25 | #define power_twi1_enable() (PRR0 &= (uint8_t)~(1 << PRTWI1)) 26 | #define power_twi1_disable() (PRR0 |= (uint8_t)(1 << PRTWI1)) 27 | @@ -814,6 +824,11 @@ 28 | #define power_spi_disable() (PRR1 |= (uint8_t)(1 << PRSPI)) 29 | #endif 30 | 31 | +#if defined(__AVR_HAVE_PRR1_PRSPI1) 32 | +#define power_spi1_enable() (PRR1 &= (uint8_t)~(1 << PRSPI1)) 33 | +#define power_spi1_disable() (PRR1 |= (uint8_t)(1 << PRSPI1)) 34 | +#endif 35 | + 36 | #if defined(__AVR_HAVE_PRR1_PRT1) 37 | #define power_timer1_enable() (PRR1 &= (uint8_t)~(1 << PRT1)) 38 | #define power_timer1_disable() (PRR1 |= (uint8_t)(1 << PRT1)) 39 | @@ -859,6 +874,11 @@ 40 | #define power_transceiver_disable() (PRR1 |= (uint8_t)(1 << PRTRX24)) 41 | #endif 42 | 43 | +#if defined(__AVR_HAVE_PRR1_PRTWI1) 44 | +#define power_twi1_enable() (PRR1 &= (uint8_t)~(1 << PRTWI1)) 45 | +#define power_twi1_disable() (PRR1 |= (uint8_t)(1 << PRTWI1)) 46 | +#endif 47 | + 48 | #if defined(__AVR_HAVE_PRR1_PRUSART1) 49 | #define power_usart1_enable() (PRR1 &= (uint8_t)~(1 << PRUSART1)) 50 | #define power_usart1_disable() (PRR1 |= (uint8_t)(1 << PRUSART1)) 51 | @@ -924,6 +944,11 @@ 52 | #define power_preamble_rssi_fifo_disable() (PRR2 |= (uint8_t)(1 << PRSF)) 53 | #endif 54 | 55 | +#if defined(__AVR_HAVE_PRR2_PRSPI1) 56 | +#define power_spi1_enable() (PRR2 &= (uint8_t)~(1 << PRSPI1)) 57 | +#define power_spi1_disable() (PRR2 |= (uint8_t)(1 << PRSPI1)) 58 | +#endif 59 | + 60 | #if defined(__AVR_HAVE_PRR2_PRSPI2) 61 | #define power_spi2_enable() (PRR2 &= (uint8_t)~(1 << PRSPI2)) 62 | #define power_spi2_disable() (PRR2 |= (uint8_t)(1 << PRSPI2)) 63 | @@ -939,11 +964,21 @@ 64 | #define power_tx_modulator_disable() (PRR2 |= (uint8_t)(1 << PRTM)) 65 | #endif 66 | 67 | +#if defined(__AVR_HAVE_PRR2_PRTWI1) 68 | +#define power_twi1_enable() (PRR2 &= (uint8_t)~(1 << PRTWI1)) 69 | +#define power_twi1_disable() (PRR2 |= (uint8_t)(1 << PRTWI1)) 70 | +#endif 71 | + 72 | #if defined(__AVR_HAVE_PRR2_PRTWI2) 73 | #define power_twi2_enable() (PRR2 &= (uint8_t)~(1 << PRTWI2)) 74 | #define power_twi2_disable() (PRR2 |= (uint8_t)(1 << PRTWI2)) 75 | #endif 76 | 77 | +#if defined(__AVR_HAVE_PRR2_PRUSART2) 78 | +#define power_usart2_enable() (PRR2 &= (uint8_t)~(1 << PRUSART2)) 79 | +#define power_usart2_disable() (PRR2 |= (uint8_t)(1 << PRUSART2)) 80 | +#endif 81 | + 82 | #if defined(__AVR_HAVE_PRR2_PRXA) 83 | #define power_rx_buffer_A_enable() (PRR2 &= (uint8_t)~(1 << PRXA)) 84 | #define power_rx_buffer_A_disable() (PRR2 |= (uint8_t)(1 << PRXA)) 85 | @@ -1350,6 +1385,7 @@ 86 | || defined(__AVR_ATmega324A__) \ 87 | || defined(__AVR_ATmega324P__) \ 88 | || defined(__AVR_ATmega324PA__) \ 89 | +|| defined(__AVR_ATmega324PB__) \ 90 | || defined(__AVR_ATmega325__) \ 91 | || defined(__AVR_ATmega325A__) \ 92 | || defined(__AVR_ATmega325P__) \ 93 | @@ -1360,6 +1396,7 @@ 94 | || defined(__AVR_ATmega3250PA__) \ 95 | || defined(__AVR_ATmega328__) \ 96 | || defined(__AVR_ATmega328P__) \ 97 | +|| defined(__AVR_ATmega328PB__) \ 98 | || defined(__AVR_ATmega329__) \ 99 | || defined(__AVR_ATmega329A__) \ 100 | || defined(__AVR_ATmega329P__) \ 101 | -------------------------------------------------------------------------------- /avr-libc-patches/03-eeprom.patch: -------------------------------------------------------------------------------- 1 | --- a/include/avr/eeprom.h 2020-05-26 14:04:10.000000000 +0200 2 | +++ b/include/avr/eeprom.h 2020-05-26 11:29:38.153645260 +0200 3 | @@ -112,8 +112,10 @@ 4 | */ 5 | #if defined (__DOXYGEN__) 6 | # define eeprom_is_ready() 7 | -#elif defined (__AVR_XMEGA__) && __AVR_XMEGA__ 8 | +#elif defined (NVM_STATUS) 9 | # define eeprom_is_ready() bit_is_clear (NVM_STATUS, NVM_NVMBUSY_bp) 10 | +#elif defined (NVMCTRL_STATUS) 11 | +# define eeprom_is_ready() bit_is_clear (NVMCTRL_STATUS, NVMCTRL_EEBUSY_bp) 12 | #elif defined (DEECR) 13 | # define eeprom_is_ready() bit_is_clear (DEECR, BSY) 14 | #elif defined (EEPE) 15 | -------------------------------------------------------------------------------- /avr-libc.build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2014-2015 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | source build.conf 19 | 20 | if [[ ! -d toolsdir ]] ; 21 | then 22 | echo "You must first build the tools: run build_tools.bash" 23 | exit 1 24 | fi 25 | 26 | cd toolsdir/bin 27 | TOOLS_BIN_PATH=`pwd` 28 | cd - 29 | 30 | export PATH="$TOOLS_BIN_PATH:$PATH" 31 | 32 | if [[ ! -f avr-libc.tar.bz2 ]] ; 33 | then 34 | wget $AVR_SOURCES/avr-libc.tar.bz2 35 | fi 36 | 37 | if [[ $OS == "Msys" || $OS == "Cygwin" ]] ; then 38 | # filename containing "aux" are not allowed in Windows environments 39 | # let's just exclude it since it's only a test 40 | EXCLUDE="--exclude=aux.c" 41 | else 42 | EXCLUDE="" 43 | fi 44 | tar xf avr-libc.tar.bz2 $EXCLUDE 45 | mv libc/avr-libc . 46 | rmdir libc 47 | 48 | cd avr-libc 49 | for p in ../avr-libc-patches/*.patch 50 | do 51 | echo Applying $p 52 | patch -p1 < $p 53 | done 54 | cd - 55 | 56 | if [[ ! -f avr8-headers.zip ]] ; 57 | then 58 | wget $AVR_SOURCES/avr8-headers.zip 59 | fi 60 | 61 | unzip avr8-headers.zip -d avr8-headers 62 | 63 | for i in avr8-headers/avr/io[0-9a-zA-Z]*.h 64 | do 65 | cp -v -f $i avr-libc/include/avr/ 66 | done 67 | 68 | cd avr-libc 69 | ./bootstrap 70 | cd - 71 | 72 | mkdir -p objdir 73 | cd objdir 74 | PREFIX=`pwd` 75 | cd - 76 | 77 | export OLDPATH="$PATH" 78 | 79 | # Add to path only if we are not cross compiling 80 | if [[ x$CROSS_COMPILE == "x" ]]; then 81 | export PATH="$PREFIX/bin:$PATH" 82 | fi 83 | 84 | mkdir -p avr-libc-build 85 | cd avr-libc-build 86 | 87 | CONFARGS=" \ 88 | --prefix=$PREFIX \ 89 | --host=avr \ 90 | --enable-device-lib \ 91 | --libdir=$PREFIX/lib \ 92 | --disable-doc" 93 | 94 | CC="avr-gcc" CXX="avr-g++" CFLAGS="-w -Os $CFLAGS" CXXFLAGS="-w -Os $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ../avr-libc/configure $CONFARGS 95 | 96 | if [ -z "$MAKE_JOBS" ]; then 97 | MAKE_JOBS="2" 98 | fi 99 | 100 | nice -n 10 make -j $MAKE_JOBS 101 | 102 | make install 103 | 104 | export PATH="$OLDPATH" 105 | -------------------------------------------------------------------------------- /binutils-patches/00-binutils-data_region_length.patch: -------------------------------------------------------------------------------- 1 | diff --git a/ld/scripttempl/avr.sc b/ld/scripttempl/avr.sc 2 | index 26b9b4c9..82d33b98 100644 3 | --- a/ld/scripttempl/avr.sc 4 | +++ b/ld/scripttempl/avr.sc 5 | @@ -33,10 +33,11 @@ __LOCK_REGION_LENGTH__ = DEFINED(__LOCK_REGION_LENGTH__) ? __LOCK_REGION_LENGTH_ 6 | __SIGNATURE_REGION_LENGTH__ = DEFINED(__SIGNATURE_REGION_LENGTH__) ? __SIGNATURE_REGION_LENGTH__ : $SIGNATURE_LENGTH; 7 | ${USER_SIGNATURE_LENGTH+__USER_SIGNATURE_REGION_LENGTH__ = DEFINED(__USER_SIGNATURE_REGION_LENGTH__) ? __USER_SIGNATURE_REGION_LENGTH__ : $USER_SIGNATURE_LENGTH;} 8 | ${RODATA_PM_OFFSET+__RODATA_PM_OFFSET__ = DEFINED(__RODATA_PM_OFFSET__) ? __RODATA_PM_OFFSET__ : $RODATA_PM_OFFSET;} 9 | +__DATA_REGION_ORIGIN__ = DEFINED(__DATA_REGION_ORIGIN__) ? __DATA_REGION_ORIGIN__ : $DATA_ORIGIN; 10 | MEMORY 11 | { 12 | text (rx) : ORIGIN = 0, LENGTH = __TEXT_REGION_LENGTH__ 13 | - data (rw!x) : ORIGIN = $DATA_ORIGIN, LENGTH = __DATA_REGION_LENGTH__ 14 | + data (rw!x) : ORIGIN = __DATA_REGION_ORIGIN__, LENGTH = __DATA_REGION_LENGTH__ 15 | ${EEPROM_LENGTH+ eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = __EEPROM_REGION_LENGTH__} 16 | $FUSE_NAME (rw!x) : ORIGIN = 0x820000, LENGTH = __FUSE_REGION_LENGTH__ 17 | lock (rw!x) : ORIGIN = 0x830000, LENGTH = __LOCK_REGION_LENGTH__ 18 | -------------------------------------------------------------------------------- /binutils.build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2014-2015 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | source build.conf 19 | 20 | if [[ ! -d toolsdir ]] ; 21 | then 22 | echo "You must first build the tools: run build_tools.bash" 23 | exit 1 24 | fi 25 | 26 | if [[ x$CROSS_COMPILE != x ]] ; then 27 | EXTRA_CONFARGS="--host=$OUTPUT_TAG" 28 | fi 29 | 30 | cd toolsdir/bin 31 | TOOLS_BIN_PATH=`pwd` 32 | cd - 33 | 34 | export PATH="$TOOLS_BIN_PATH:$PATH" 35 | 36 | if [[ ! -f avr-binutils.tar.bz2 ]] ; 37 | then 38 | wget $AVR_SOURCES/avr-binutils.tar.bz2 39 | fi 40 | tar xf avr-binutils.tar.bz2 41 | 42 | cd binutils 43 | for p in ../binutils-patches/*.patch; do echo Applying $p; patch -p1 < $p; done 44 | autoconf 45 | cd ld 46 | autoreconf 47 | cd ../../ 48 | 49 | mkdir -p objdir 50 | cd objdir 51 | PREFIX=`pwd` 52 | cd - 53 | 54 | mkdir -p binutils-build 55 | cd binutils-build 56 | 57 | CONFARGS=" \ 58 | --enable-languages=c,c++ \ 59 | --prefix=$PREFIX \ 60 | --disable-nls \ 61 | --disable-doc \ 62 | --disable-werror \ 63 | --enable-install-libiberty \ 64 | --enable-install-libbfd \ 65 | --disable-libdecnumber \ 66 | --disable-gdb \ 67 | --disable-readline \ 68 | --disable-sim \ 69 | --target=avr" 70 | 71 | CFLAGS="-w -O2 -g0 $CFLAGS" CXXFLAGS="-w -O2 -g0 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ../binutils/configure $CONFARGS $EXTRA_CONFARGS 72 | 73 | if [ -z "$MAKE_JOBS" ]; then 74 | MAKE_JOBS="2" 75 | fi 76 | 77 | nice -n 10 make -j $MAKE_JOBS configure-host 78 | nice -n 10 make -j $MAKE_JOBS all 79 | 80 | make install 81 | 82 | -------------------------------------------------------------------------------- /config.guess-am-1.11.4: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Attempt to guess a canonical system name. 3 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 4 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 5 | # 2011, 2012 Free Software Foundation, Inc. 6 | 7 | timestamp='2012-02-10' 8 | 9 | # This file is free software; you can redistribute it and/or modify it 10 | # under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 2 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, but 15 | # WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | # General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program; if not, see . 21 | # 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | 28 | # Originally written by Per Bothner. Please send patches (context 29 | # diff format) to and include a ChangeLog 30 | # entry. 31 | # 32 | # This script attempts to guess a canonical system name similar to 33 | # config.sub. If it succeeds, it prints the system name on stdout, and 34 | # exits with 0. Otherwise, it exits with 1. 35 | # 36 | # You can get the latest version of this script from: 37 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 38 | 39 | me=`echo "$0" | sed -e 's,.*/,,'` 40 | 41 | usage="\ 42 | Usage: $0 [OPTION] 43 | 44 | Output the configuration name of the system \`$me' is run on. 45 | 46 | Operation modes: 47 | -h, --help print this help, then exit 48 | -t, --time-stamp print date of last modification, then exit 49 | -v, --version print version number, then exit 50 | 51 | Report bugs and patches to ." 52 | 53 | version="\ 54 | GNU config.guess ($timestamp) 55 | 56 | Originally written by Per Bothner. 57 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 58 | 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 59 | Free Software Foundation, Inc. 60 | 61 | This is free software; see the source for copying conditions. There is NO 62 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 63 | 64 | help=" 65 | Try \`$me --help' for more information." 66 | 67 | # Parse command line 68 | while test $# -gt 0 ; do 69 | case $1 in 70 | --time-stamp | --time* | -t ) 71 | echo "$timestamp" ; exit ;; 72 | --version | -v ) 73 | echo "$version" ; exit ;; 74 | --help | --h* | -h ) 75 | echo "$usage"; exit ;; 76 | -- ) # Stop option processing 77 | shift; break ;; 78 | - ) # Use stdin as input. 79 | break ;; 80 | -* ) 81 | echo "$me: invalid option $1$help" >&2 82 | exit 1 ;; 83 | * ) 84 | break ;; 85 | esac 86 | done 87 | 88 | if test $# != 0; then 89 | echo "$me: too many arguments$help" >&2 90 | exit 1 91 | fi 92 | 93 | trap 'exit 1' 1 2 15 94 | 95 | # CC_FOR_BUILD -- compiler used by this script. Note that the use of a 96 | # compiler to aid in system detection is discouraged as it requires 97 | # temporary files to be created and, as you can see below, it is a 98 | # headache to deal with in a portable fashion. 99 | 100 | # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 101 | # use `HOST_CC' if defined, but it is deprecated. 102 | 103 | # Portable tmp directory creation inspired by the Autoconf team. 104 | 105 | set_cc_for_build=' 106 | trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 107 | trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 108 | : ${TMPDIR=/tmp} ; 109 | { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 110 | { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 111 | { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 112 | { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 113 | dummy=$tmp/dummy ; 114 | tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 115 | case $CC_FOR_BUILD,$HOST_CC,$CC in 116 | ,,) echo "int x;" > $dummy.c ; 117 | for c in cc gcc c89 c99 ; do 118 | if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 119 | CC_FOR_BUILD="$c"; break ; 120 | fi ; 121 | done ; 122 | if test x"$CC_FOR_BUILD" = x ; then 123 | CC_FOR_BUILD=no_compiler_found ; 124 | fi 125 | ;; 126 | ,,*) CC_FOR_BUILD=$CC ;; 127 | ,*,*) CC_FOR_BUILD=$HOST_CC ;; 128 | esac ; set_cc_for_build= ;' 129 | 130 | # This is needed to find uname on a Pyramid OSx when run in the BSD universe. 131 | # (ghazi@noc.rutgers.edu 1994-08-24) 132 | if (test -f /.attbin/uname) >/dev/null 2>&1 ; then 133 | PATH=$PATH:/.attbin ; export PATH 134 | fi 135 | 136 | UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 137 | UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 138 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 139 | UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 140 | 141 | # Note: order is significant - the case branches are not exclusive. 142 | 143 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 144 | *:NetBSD:*:*) 145 | # NetBSD (nbsd) targets should (where applicable) match one or 146 | # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 147 | # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 148 | # switched to ELF, *-*-netbsd* would select the old 149 | # object file format. This provides both forward 150 | # compatibility and a consistent mechanism for selecting the 151 | # object file format. 152 | # 153 | # Note: NetBSD doesn't particularly care about the vendor 154 | # portion of the name. We always set it to "unknown". 155 | sysctl="sysctl -n hw.machine_arch" 156 | UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ 157 | /usr/sbin/$sysctl 2>/dev/null || echo unknown)` 158 | case "${UNAME_MACHINE_ARCH}" in 159 | armeb) machine=armeb-unknown ;; 160 | arm*) machine=arm-unknown ;; 161 | sh3el) machine=shl-unknown ;; 162 | sh3eb) machine=sh-unknown ;; 163 | sh5el) machine=sh5le-unknown ;; 164 | *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 165 | esac 166 | # The Operating System including object format, if it has switched 167 | # to ELF recently, or will in the future. 168 | case "${UNAME_MACHINE_ARCH}" in 169 | arm*|i386|m68k|ns32k|sh3*|sparc|vax) 170 | eval $set_cc_for_build 171 | if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 172 | | grep -q __ELF__ 173 | then 174 | # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 175 | # Return netbsd for either. FIX? 176 | os=netbsd 177 | else 178 | os=netbsdelf 179 | fi 180 | ;; 181 | *) 182 | os=netbsd 183 | ;; 184 | esac 185 | # The OS release 186 | # Debian GNU/NetBSD machines have a different userland, and 187 | # thus, need a distinct triplet. However, they do not need 188 | # kernel version information, so it can be replaced with a 189 | # suitable tag, in the style of linux-gnu. 190 | case "${UNAME_VERSION}" in 191 | Debian*) 192 | release='-gnu' 193 | ;; 194 | *) 195 | release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 196 | ;; 197 | esac 198 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 199 | # contains redundant information, the shorter form: 200 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 201 | echo "${machine}-${os}${release}" 202 | exit ;; 203 | *:OpenBSD:*:*) 204 | UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 205 | echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 206 | exit ;; 207 | *:ekkoBSD:*:*) 208 | echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 209 | exit ;; 210 | *:SolidBSD:*:*) 211 | echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 212 | exit ;; 213 | macppc:MirBSD:*:*) 214 | echo powerpc-unknown-mirbsd${UNAME_RELEASE} 215 | exit ;; 216 | *:MirBSD:*:*) 217 | echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 218 | exit ;; 219 | alpha:OSF1:*:*) 220 | case $UNAME_RELEASE in 221 | *4.0) 222 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 223 | ;; 224 | *5.*) 225 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 226 | ;; 227 | esac 228 | # According to Compaq, /usr/sbin/psrinfo has been available on 229 | # OSF/1 and Tru64 systems produced since 1995. I hope that 230 | # covers most systems running today. This code pipes the CPU 231 | # types through head -n 1, so we only detect the type of CPU 0. 232 | ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 233 | case "$ALPHA_CPU_TYPE" in 234 | "EV4 (21064)") 235 | UNAME_MACHINE="alpha" ;; 236 | "EV4.5 (21064)") 237 | UNAME_MACHINE="alpha" ;; 238 | "LCA4 (21066/21068)") 239 | UNAME_MACHINE="alpha" ;; 240 | "EV5 (21164)") 241 | UNAME_MACHINE="alphaev5" ;; 242 | "EV5.6 (21164A)") 243 | UNAME_MACHINE="alphaev56" ;; 244 | "EV5.6 (21164PC)") 245 | UNAME_MACHINE="alphapca56" ;; 246 | "EV5.7 (21164PC)") 247 | UNAME_MACHINE="alphapca57" ;; 248 | "EV6 (21264)") 249 | UNAME_MACHINE="alphaev6" ;; 250 | "EV6.7 (21264A)") 251 | UNAME_MACHINE="alphaev67" ;; 252 | "EV6.8CB (21264C)") 253 | UNAME_MACHINE="alphaev68" ;; 254 | "EV6.8AL (21264B)") 255 | UNAME_MACHINE="alphaev68" ;; 256 | "EV6.8CX (21264D)") 257 | UNAME_MACHINE="alphaev68" ;; 258 | "EV6.9A (21264/EV69A)") 259 | UNAME_MACHINE="alphaev69" ;; 260 | "EV7 (21364)") 261 | UNAME_MACHINE="alphaev7" ;; 262 | "EV7.9 (21364A)") 263 | UNAME_MACHINE="alphaev79" ;; 264 | esac 265 | # A Pn.n version is a patched version. 266 | # A Vn.n version is a released version. 267 | # A Tn.n version is a released field test version. 268 | # A Xn.n version is an unreleased experimental baselevel. 269 | # 1.2 uses "1.2" for uname -r. 270 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 271 | # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 272 | exitcode=$? 273 | trap '' 0 274 | exit $exitcode ;; 275 | Alpha\ *:Windows_NT*:*) 276 | # How do we know it's Interix rather than the generic POSIX subsystem? 277 | # Should we change UNAME_MACHINE based on the output of uname instead 278 | # of the specific Alpha model? 279 | echo alpha-pc-interix 280 | exit ;; 281 | 21064:Windows_NT:50:3) 282 | echo alpha-dec-winnt3.5 283 | exit ;; 284 | Amiga*:UNIX_System_V:4.0:*) 285 | echo m68k-unknown-sysv4 286 | exit ;; 287 | *:[Aa]miga[Oo][Ss]:*:*) 288 | echo ${UNAME_MACHINE}-unknown-amigaos 289 | exit ;; 290 | *:[Mm]orph[Oo][Ss]:*:*) 291 | echo ${UNAME_MACHINE}-unknown-morphos 292 | exit ;; 293 | *:OS/390:*:*) 294 | echo i370-ibm-openedition 295 | exit ;; 296 | *:z/VM:*:*) 297 | echo s390-ibm-zvmoe 298 | exit ;; 299 | *:OS400:*:*) 300 | echo powerpc-ibm-os400 301 | exit ;; 302 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 303 | echo arm-acorn-riscix${UNAME_RELEASE} 304 | exit ;; 305 | arm:riscos:*:*|arm:RISCOS:*:*) 306 | echo arm-unknown-riscos 307 | exit ;; 308 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 309 | echo hppa1.1-hitachi-hiuxmpp 310 | exit ;; 311 | Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 312 | # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 313 | if test "`(/bin/universe) 2>/dev/null`" = att ; then 314 | echo pyramid-pyramid-sysv3 315 | else 316 | echo pyramid-pyramid-bsd 317 | fi 318 | exit ;; 319 | NILE*:*:*:dcosx) 320 | echo pyramid-pyramid-svr4 321 | exit ;; 322 | DRS?6000:unix:4.0:6*) 323 | echo sparc-icl-nx6 324 | exit ;; 325 | DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 326 | case `/usr/bin/uname -p` in 327 | sparc) echo sparc-icl-nx7; exit ;; 328 | esac ;; 329 | s390x:SunOS:*:*) 330 | echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 331 | exit ;; 332 | sun4H:SunOS:5.*:*) 333 | echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 334 | exit ;; 335 | sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 336 | echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 337 | exit ;; 338 | i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 339 | echo i386-pc-auroraux${UNAME_RELEASE} 340 | exit ;; 341 | i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 342 | eval $set_cc_for_build 343 | SUN_ARCH="i386" 344 | # If there is a compiler, see if it is configured for 64-bit objects. 345 | # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 346 | # This test works for both compilers. 347 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 348 | if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 349 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 350 | grep IS_64BIT_ARCH >/dev/null 351 | then 352 | SUN_ARCH="x86_64" 353 | fi 354 | fi 355 | echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 356 | exit ;; 357 | sun4*:SunOS:6*:*) 358 | # According to config.sub, this is the proper way to canonicalize 359 | # SunOS6. Hard to guess exactly what SunOS6 will be like, but 360 | # it's likely to be more like Solaris than SunOS4. 361 | echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 362 | exit ;; 363 | sun4*:SunOS:*:*) 364 | case "`/usr/bin/arch -k`" in 365 | Series*|S4*) 366 | UNAME_RELEASE=`uname -v` 367 | ;; 368 | esac 369 | # Japanese Language versions have a version number like `4.1.3-JL'. 370 | echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 371 | exit ;; 372 | sun3*:SunOS:*:*) 373 | echo m68k-sun-sunos${UNAME_RELEASE} 374 | exit ;; 375 | sun*:*:4.2BSD:*) 376 | UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 377 | test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 378 | case "`/bin/arch`" in 379 | sun3) 380 | echo m68k-sun-sunos${UNAME_RELEASE} 381 | ;; 382 | sun4) 383 | echo sparc-sun-sunos${UNAME_RELEASE} 384 | ;; 385 | esac 386 | exit ;; 387 | aushp:SunOS:*:*) 388 | echo sparc-auspex-sunos${UNAME_RELEASE} 389 | exit ;; 390 | # The situation for MiNT is a little confusing. The machine name 391 | # can be virtually everything (everything which is not 392 | # "atarist" or "atariste" at least should have a processor 393 | # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 394 | # to the lowercase version "mint" (or "freemint"). Finally 395 | # the system name "TOS" denotes a system which is actually not 396 | # MiNT. But MiNT is downward compatible to TOS, so this should 397 | # be no problem. 398 | atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 399 | echo m68k-atari-mint${UNAME_RELEASE} 400 | exit ;; 401 | atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 402 | echo m68k-atari-mint${UNAME_RELEASE} 403 | exit ;; 404 | *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 405 | echo m68k-atari-mint${UNAME_RELEASE} 406 | exit ;; 407 | milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 408 | echo m68k-milan-mint${UNAME_RELEASE} 409 | exit ;; 410 | hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 411 | echo m68k-hades-mint${UNAME_RELEASE} 412 | exit ;; 413 | *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 414 | echo m68k-unknown-mint${UNAME_RELEASE} 415 | exit ;; 416 | m68k:machten:*:*) 417 | echo m68k-apple-machten${UNAME_RELEASE} 418 | exit ;; 419 | powerpc:machten:*:*) 420 | echo powerpc-apple-machten${UNAME_RELEASE} 421 | exit ;; 422 | RISC*:Mach:*:*) 423 | echo mips-dec-mach_bsd4.3 424 | exit ;; 425 | RISC*:ULTRIX:*:*) 426 | echo mips-dec-ultrix${UNAME_RELEASE} 427 | exit ;; 428 | VAX*:ULTRIX*:*:*) 429 | echo vax-dec-ultrix${UNAME_RELEASE} 430 | exit ;; 431 | 2020:CLIX:*:* | 2430:CLIX:*:*) 432 | echo clipper-intergraph-clix${UNAME_RELEASE} 433 | exit ;; 434 | mips:*:*:UMIPS | mips:*:*:RISCos) 435 | eval $set_cc_for_build 436 | sed 's/^ //' << EOF >$dummy.c 437 | #ifdef __cplusplus 438 | #include /* for printf() prototype */ 439 | int main (int argc, char *argv[]) { 440 | #else 441 | int main (argc, argv) int argc; char *argv[]; { 442 | #endif 443 | #if defined (host_mips) && defined (MIPSEB) 444 | #if defined (SYSTYPE_SYSV) 445 | printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 446 | #endif 447 | #if defined (SYSTYPE_SVR4) 448 | printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 449 | #endif 450 | #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 451 | printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 452 | #endif 453 | #endif 454 | exit (-1); 455 | } 456 | EOF 457 | $CC_FOR_BUILD -o $dummy $dummy.c && 458 | dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 459 | SYSTEM_NAME=`$dummy $dummyarg` && 460 | { echo "$SYSTEM_NAME"; exit; } 461 | echo mips-mips-riscos${UNAME_RELEASE} 462 | exit ;; 463 | Motorola:PowerMAX_OS:*:*) 464 | echo powerpc-motorola-powermax 465 | exit ;; 466 | Motorola:*:4.3:PL8-*) 467 | echo powerpc-harris-powermax 468 | exit ;; 469 | Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 470 | echo powerpc-harris-powermax 471 | exit ;; 472 | Night_Hawk:Power_UNIX:*:*) 473 | echo powerpc-harris-powerunix 474 | exit ;; 475 | m88k:CX/UX:7*:*) 476 | echo m88k-harris-cxux7 477 | exit ;; 478 | m88k:*:4*:R4*) 479 | echo m88k-motorola-sysv4 480 | exit ;; 481 | m88k:*:3*:R3*) 482 | echo m88k-motorola-sysv3 483 | exit ;; 484 | AViiON:dgux:*:*) 485 | # DG/UX returns AViiON for all architectures 486 | UNAME_PROCESSOR=`/usr/bin/uname -p` 487 | if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 488 | then 489 | if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 490 | [ ${TARGET_BINARY_INTERFACE}x = x ] 491 | then 492 | echo m88k-dg-dgux${UNAME_RELEASE} 493 | else 494 | echo m88k-dg-dguxbcs${UNAME_RELEASE} 495 | fi 496 | else 497 | echo i586-dg-dgux${UNAME_RELEASE} 498 | fi 499 | exit ;; 500 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) 501 | echo m88k-dolphin-sysv3 502 | exit ;; 503 | M88*:*:R3*:*) 504 | # Delta 88k system running SVR3 505 | echo m88k-motorola-sysv3 506 | exit ;; 507 | XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 508 | echo m88k-tektronix-sysv3 509 | exit ;; 510 | Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 511 | echo m68k-tektronix-bsd 512 | exit ;; 513 | *:IRIX*:*:*) 514 | echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 515 | exit ;; 516 | ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 517 | echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 518 | exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 519 | i*86:AIX:*:*) 520 | echo i386-ibm-aix 521 | exit ;; 522 | ia64:AIX:*:*) 523 | if [ -x /usr/bin/oslevel ] ; then 524 | IBM_REV=`/usr/bin/oslevel` 525 | else 526 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 527 | fi 528 | echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 529 | exit ;; 530 | *:AIX:2:3) 531 | if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 532 | eval $set_cc_for_build 533 | sed 's/^ //' << EOF >$dummy.c 534 | #include 535 | 536 | main() 537 | { 538 | if (!__power_pc()) 539 | exit(1); 540 | puts("powerpc-ibm-aix3.2.5"); 541 | exit(0); 542 | } 543 | EOF 544 | if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 545 | then 546 | echo "$SYSTEM_NAME" 547 | else 548 | echo rs6000-ibm-aix3.2.5 549 | fi 550 | elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 551 | echo rs6000-ibm-aix3.2.4 552 | else 553 | echo rs6000-ibm-aix3.2 554 | fi 555 | exit ;; 556 | *:AIX:*:[4567]) 557 | IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 558 | if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 559 | IBM_ARCH=rs6000 560 | else 561 | IBM_ARCH=powerpc 562 | fi 563 | if [ -x /usr/bin/oslevel ] ; then 564 | IBM_REV=`/usr/bin/oslevel` 565 | else 566 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 567 | fi 568 | echo ${IBM_ARCH}-ibm-aix${IBM_REV} 569 | exit ;; 570 | *:AIX:*:*) 571 | echo rs6000-ibm-aix 572 | exit ;; 573 | ibmrt:4.4BSD:*|romp-ibm:BSD:*) 574 | echo romp-ibm-bsd4.4 575 | exit ;; 576 | ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 577 | echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 578 | exit ;; # report: romp-ibm BSD 4.3 579 | *:BOSX:*:*) 580 | echo rs6000-bull-bosx 581 | exit ;; 582 | DPX/2?00:B.O.S.:*:*) 583 | echo m68k-bull-sysv3 584 | exit ;; 585 | 9000/[34]??:4.3bsd:1.*:*) 586 | echo m68k-hp-bsd 587 | exit ;; 588 | hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 589 | echo m68k-hp-bsd4.4 590 | exit ;; 591 | 9000/[34678]??:HP-UX:*:*) 592 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 593 | case "${UNAME_MACHINE}" in 594 | 9000/31? ) HP_ARCH=m68000 ;; 595 | 9000/[34]?? ) HP_ARCH=m68k ;; 596 | 9000/[678][0-9][0-9]) 597 | if [ -x /usr/bin/getconf ]; then 598 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 599 | sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 600 | case "${sc_cpu_version}" in 601 | 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 602 | 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 603 | 532) # CPU_PA_RISC2_0 604 | case "${sc_kernel_bits}" in 605 | 32) HP_ARCH="hppa2.0n" ;; 606 | 64) HP_ARCH="hppa2.0w" ;; 607 | '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 608 | esac ;; 609 | esac 610 | fi 611 | if [ "${HP_ARCH}" = "" ]; then 612 | eval $set_cc_for_build 613 | sed 's/^ //' << EOF >$dummy.c 614 | 615 | #define _HPUX_SOURCE 616 | #include 617 | #include 618 | 619 | int main () 620 | { 621 | #if defined(_SC_KERNEL_BITS) 622 | long bits = sysconf(_SC_KERNEL_BITS); 623 | #endif 624 | long cpu = sysconf (_SC_CPU_VERSION); 625 | 626 | switch (cpu) 627 | { 628 | case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 629 | case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 630 | case CPU_PA_RISC2_0: 631 | #if defined(_SC_KERNEL_BITS) 632 | switch (bits) 633 | { 634 | case 64: puts ("hppa2.0w"); break; 635 | case 32: puts ("hppa2.0n"); break; 636 | default: puts ("hppa2.0"); break; 637 | } break; 638 | #else /* !defined(_SC_KERNEL_BITS) */ 639 | puts ("hppa2.0"); break; 640 | #endif 641 | default: puts ("hppa1.0"); break; 642 | } 643 | exit (0); 644 | } 645 | EOF 646 | (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 647 | test -z "$HP_ARCH" && HP_ARCH=hppa 648 | fi ;; 649 | esac 650 | if [ ${HP_ARCH} = "hppa2.0w" ] 651 | then 652 | eval $set_cc_for_build 653 | 654 | # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 655 | # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 656 | # generating 64-bit code. GNU and HP use different nomenclature: 657 | # 658 | # $ CC_FOR_BUILD=cc ./config.guess 659 | # => hppa2.0w-hp-hpux11.23 660 | # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 661 | # => hppa64-hp-hpux11.23 662 | 663 | if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 664 | grep -q __LP64__ 665 | then 666 | HP_ARCH="hppa2.0w" 667 | else 668 | HP_ARCH="hppa64" 669 | fi 670 | fi 671 | echo ${HP_ARCH}-hp-hpux${HPUX_REV} 672 | exit ;; 673 | ia64:HP-UX:*:*) 674 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 675 | echo ia64-hp-hpux${HPUX_REV} 676 | exit ;; 677 | 3050*:HI-UX:*:*) 678 | eval $set_cc_for_build 679 | sed 's/^ //' << EOF >$dummy.c 680 | #include 681 | int 682 | main () 683 | { 684 | long cpu = sysconf (_SC_CPU_VERSION); 685 | /* The order matters, because CPU_IS_HP_MC68K erroneously returns 686 | true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 687 | results, however. */ 688 | if (CPU_IS_PA_RISC (cpu)) 689 | { 690 | switch (cpu) 691 | { 692 | case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 693 | case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 694 | case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 695 | default: puts ("hppa-hitachi-hiuxwe2"); break; 696 | } 697 | } 698 | else if (CPU_IS_HP_MC68K (cpu)) 699 | puts ("m68k-hitachi-hiuxwe2"); 700 | else puts ("unknown-hitachi-hiuxwe2"); 701 | exit (0); 702 | } 703 | EOF 704 | $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 705 | { echo "$SYSTEM_NAME"; exit; } 706 | echo unknown-hitachi-hiuxwe2 707 | exit ;; 708 | 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 709 | echo hppa1.1-hp-bsd 710 | exit ;; 711 | 9000/8??:4.3bsd:*:*) 712 | echo hppa1.0-hp-bsd 713 | exit ;; 714 | *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 715 | echo hppa1.0-hp-mpeix 716 | exit ;; 717 | hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 718 | echo hppa1.1-hp-osf 719 | exit ;; 720 | hp8??:OSF1:*:*) 721 | echo hppa1.0-hp-osf 722 | exit ;; 723 | i*86:OSF1:*:*) 724 | if [ -x /usr/sbin/sysversion ] ; then 725 | echo ${UNAME_MACHINE}-unknown-osf1mk 726 | else 727 | echo ${UNAME_MACHINE}-unknown-osf1 728 | fi 729 | exit ;; 730 | parisc*:Lites*:*:*) 731 | echo hppa1.1-hp-lites 732 | exit ;; 733 | C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 734 | echo c1-convex-bsd 735 | exit ;; 736 | C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 737 | if getsysinfo -f scalar_acc 738 | then echo c32-convex-bsd 739 | else echo c2-convex-bsd 740 | fi 741 | exit ;; 742 | C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 743 | echo c34-convex-bsd 744 | exit ;; 745 | C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 746 | echo c38-convex-bsd 747 | exit ;; 748 | C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 749 | echo c4-convex-bsd 750 | exit ;; 751 | CRAY*Y-MP:*:*:*) 752 | echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 753 | exit ;; 754 | CRAY*[A-Z]90:*:*:*) 755 | echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 756 | | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 757 | -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 758 | -e 's/\.[^.]*$/.X/' 759 | exit ;; 760 | CRAY*TS:*:*:*) 761 | echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 762 | exit ;; 763 | CRAY*T3E:*:*:*) 764 | echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 765 | exit ;; 766 | CRAY*SV1:*:*:*) 767 | echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 768 | exit ;; 769 | *:UNICOS/mp:*:*) 770 | echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 771 | exit ;; 772 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 773 | FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 774 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 775 | FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 776 | echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 777 | exit ;; 778 | 5000:UNIX_System_V:4.*:*) 779 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 780 | FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 781 | echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 782 | exit ;; 783 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 784 | echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 785 | exit ;; 786 | sparc*:BSD/OS:*:*) 787 | echo sparc-unknown-bsdi${UNAME_RELEASE} 788 | exit ;; 789 | *:BSD/OS:*:*) 790 | echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 791 | exit ;; 792 | *:FreeBSD:*:*) 793 | UNAME_PROCESSOR=`/usr/bin/uname -p` 794 | case ${UNAME_PROCESSOR} in 795 | amd64) 796 | echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 797 | *) 798 | echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 799 | esac 800 | exit ;; 801 | i*:CYGWIN*:*) 802 | echo ${UNAME_MACHINE}-pc-cygwin 803 | exit ;; 804 | *:MINGW*:*) 805 | echo ${UNAME_MACHINE}-pc-mingw32 806 | exit ;; 807 | i*:MSYS*:*) 808 | echo ${UNAME_MACHINE}-pc-msys 809 | exit ;; 810 | i*:windows32*:*) 811 | # uname -m includes "-pc" on this system. 812 | echo ${UNAME_MACHINE}-mingw32 813 | exit ;; 814 | i*:PW*:*) 815 | echo ${UNAME_MACHINE}-pc-pw32 816 | exit ;; 817 | *:Interix*:*) 818 | case ${UNAME_MACHINE} in 819 | x86) 820 | echo i586-pc-interix${UNAME_RELEASE} 821 | exit ;; 822 | authenticamd | genuineintel | EM64T) 823 | echo x86_64-unknown-interix${UNAME_RELEASE} 824 | exit ;; 825 | IA64) 826 | echo ia64-unknown-interix${UNAME_RELEASE} 827 | exit ;; 828 | esac ;; 829 | [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 830 | echo i${UNAME_MACHINE}-pc-mks 831 | exit ;; 832 | 8664:Windows_NT:*) 833 | echo x86_64-pc-mks 834 | exit ;; 835 | i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 836 | # How do we know it's Interix rather than the generic POSIX subsystem? 837 | # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 838 | # UNAME_MACHINE based on the output of uname instead of i386? 839 | echo i586-pc-interix 840 | exit ;; 841 | i*:UWIN*:*) 842 | echo ${UNAME_MACHINE}-pc-uwin 843 | exit ;; 844 | amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 845 | echo x86_64-unknown-cygwin 846 | exit ;; 847 | p*:CYGWIN*:*) 848 | echo powerpcle-unknown-cygwin 849 | exit ;; 850 | prep*:SunOS:5.*:*) 851 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 852 | exit ;; 853 | *:GNU:*:*) 854 | # the GNU system 855 | echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 856 | exit ;; 857 | *:GNU/*:*:*) 858 | # other systems with GNU libc and userland 859 | echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu 860 | exit ;; 861 | i*86:Minix:*:*) 862 | echo ${UNAME_MACHINE}-pc-minix 863 | exit ;; 864 | aarch64:Linux:*:*) 865 | echo ${UNAME_MACHINE}-unknown-linux-gnu 866 | exit ;; 867 | aarch64_be:Linux:*:*) 868 | UNAME_MACHINE=aarch64_be 869 | echo ${UNAME_MACHINE}-unknown-linux-gnu 870 | exit ;; 871 | alpha:Linux:*:*) 872 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 873 | EV5) UNAME_MACHINE=alphaev5 ;; 874 | EV56) UNAME_MACHINE=alphaev56 ;; 875 | PCA56) UNAME_MACHINE=alphapca56 ;; 876 | PCA57) UNAME_MACHINE=alphapca56 ;; 877 | EV6) UNAME_MACHINE=alphaev6 ;; 878 | EV67) UNAME_MACHINE=alphaev67 ;; 879 | EV68*) UNAME_MACHINE=alphaev68 ;; 880 | esac 881 | objdump --private-headers /bin/sh | grep -q ld.so.1 882 | if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 883 | echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 884 | exit ;; 885 | arm*:Linux:*:*) 886 | eval $set_cc_for_build 887 | if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 888 | | grep -q __ARM_EABI__ 889 | then 890 | echo ${UNAME_MACHINE}-unknown-linux-gnu 891 | else 892 | if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 893 | | grep -q __ARM_PCS_VFP 894 | then 895 | echo ${UNAME_MACHINE}-unknown-linux-gnueabi 896 | else 897 | echo ${UNAME_MACHINE}-unknown-linux-gnueabihf 898 | fi 899 | fi 900 | exit ;; 901 | avr32*:Linux:*:*) 902 | echo ${UNAME_MACHINE}-unknown-linux-gnu 903 | exit ;; 904 | cris:Linux:*:*) 905 | echo ${UNAME_MACHINE}-axis-linux-gnu 906 | exit ;; 907 | crisv32:Linux:*:*) 908 | echo ${UNAME_MACHINE}-axis-linux-gnu 909 | exit ;; 910 | frv:Linux:*:*) 911 | echo ${UNAME_MACHINE}-unknown-linux-gnu 912 | exit ;; 913 | hexagon:Linux:*:*) 914 | echo ${UNAME_MACHINE}-unknown-linux-gnu 915 | exit ;; 916 | i*86:Linux:*:*) 917 | LIBC=gnu 918 | eval $set_cc_for_build 919 | sed 's/^ //' << EOF >$dummy.c 920 | #ifdef __dietlibc__ 921 | LIBC=dietlibc 922 | #endif 923 | EOF 924 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` 925 | echo "${UNAME_MACHINE}-pc-linux-${LIBC}" 926 | exit ;; 927 | ia64:Linux:*:*) 928 | echo ${UNAME_MACHINE}-unknown-linux-gnu 929 | exit ;; 930 | m32r*:Linux:*:*) 931 | echo ${UNAME_MACHINE}-unknown-linux-gnu 932 | exit ;; 933 | m68*:Linux:*:*) 934 | echo ${UNAME_MACHINE}-unknown-linux-gnu 935 | exit ;; 936 | mips:Linux:*:* | mips64:Linux:*:*) 937 | eval $set_cc_for_build 938 | sed 's/^ //' << EOF >$dummy.c 939 | #undef CPU 940 | #undef ${UNAME_MACHINE} 941 | #undef ${UNAME_MACHINE}el 942 | #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 943 | CPU=${UNAME_MACHINE}el 944 | #else 945 | #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 946 | CPU=${UNAME_MACHINE} 947 | #else 948 | CPU= 949 | #endif 950 | #endif 951 | EOF 952 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` 953 | test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } 954 | ;; 955 | or32:Linux:*:*) 956 | echo ${UNAME_MACHINE}-unknown-linux-gnu 957 | exit ;; 958 | padre:Linux:*:*) 959 | echo sparc-unknown-linux-gnu 960 | exit ;; 961 | parisc64:Linux:*:* | hppa64:Linux:*:*) 962 | echo hppa64-unknown-linux-gnu 963 | exit ;; 964 | parisc:Linux:*:* | hppa:Linux:*:*) 965 | # Look for CPU level 966 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 967 | PA7*) echo hppa1.1-unknown-linux-gnu ;; 968 | PA8*) echo hppa2.0-unknown-linux-gnu ;; 969 | *) echo hppa-unknown-linux-gnu ;; 970 | esac 971 | exit ;; 972 | ppc64:Linux:*:*) 973 | echo powerpc64-unknown-linux-gnu 974 | exit ;; 975 | ppc:Linux:*:*) 976 | echo powerpc-unknown-linux-gnu 977 | exit ;; 978 | s390:Linux:*:* | s390x:Linux:*:*) 979 | echo ${UNAME_MACHINE}-ibm-linux 980 | exit ;; 981 | sh64*:Linux:*:*) 982 | echo ${UNAME_MACHINE}-unknown-linux-gnu 983 | exit ;; 984 | sh*:Linux:*:*) 985 | echo ${UNAME_MACHINE}-unknown-linux-gnu 986 | exit ;; 987 | sparc:Linux:*:* | sparc64:Linux:*:*) 988 | echo ${UNAME_MACHINE}-unknown-linux-gnu 989 | exit ;; 990 | tile*:Linux:*:*) 991 | echo ${UNAME_MACHINE}-unknown-linux-gnu 992 | exit ;; 993 | vax:Linux:*:*) 994 | echo ${UNAME_MACHINE}-dec-linux-gnu 995 | exit ;; 996 | x86_64:Linux:*:*) 997 | echo ${UNAME_MACHINE}-unknown-linux-gnu 998 | exit ;; 999 | xtensa*:Linux:*:*) 1000 | echo ${UNAME_MACHINE}-unknown-linux-gnu 1001 | exit ;; 1002 | i*86:DYNIX/ptx:4*:*) 1003 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 1004 | # earlier versions are messed up and put the nodename in both 1005 | # sysname and nodename. 1006 | echo i386-sequent-sysv4 1007 | exit ;; 1008 | i*86:UNIX_SV:4.2MP:2.*) 1009 | # Unixware is an offshoot of SVR4, but it has its own version 1010 | # number series starting with 2... 1011 | # I am not positive that other SVR4 systems won't match this, 1012 | # I just have to hope. -- rms. 1013 | # Use sysv4.2uw... so that sysv4* matches it. 1014 | echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 1015 | exit ;; 1016 | i*86:OS/2:*:*) 1017 | # If we were able to find `uname', then EMX Unix compatibility 1018 | # is probably installed. 1019 | echo ${UNAME_MACHINE}-pc-os2-emx 1020 | exit ;; 1021 | i*86:XTS-300:*:STOP) 1022 | echo ${UNAME_MACHINE}-unknown-stop 1023 | exit ;; 1024 | i*86:atheos:*:*) 1025 | echo ${UNAME_MACHINE}-unknown-atheos 1026 | exit ;; 1027 | i*86:syllable:*:*) 1028 | echo ${UNAME_MACHINE}-pc-syllable 1029 | exit ;; 1030 | i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 1031 | echo i386-unknown-lynxos${UNAME_RELEASE} 1032 | exit ;; 1033 | i*86:*DOS:*:*) 1034 | echo ${UNAME_MACHINE}-pc-msdosdjgpp 1035 | exit ;; 1036 | i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 1037 | UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 1038 | if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 1039 | echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 1040 | else 1041 | echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 1042 | fi 1043 | exit ;; 1044 | i*86:*:5:[678]*) 1045 | # UnixWare 7.x, OpenUNIX and OpenServer 6. 1046 | case `/bin/uname -X | grep "^Machine"` in 1047 | *486*) UNAME_MACHINE=i486 ;; 1048 | *Pentium) UNAME_MACHINE=i586 ;; 1049 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 1050 | esac 1051 | echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 1052 | exit ;; 1053 | i*86:*:3.2:*) 1054 | if test -f /usr/options/cb.name; then 1055 | UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then 1058 | UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 1059 | (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 1060 | (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 1061 | && UNAME_MACHINE=i586 1062 | (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 1063 | && UNAME_MACHINE=i686 1064 | (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 1065 | && UNAME_MACHINE=i686 1066 | echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 1067 | else 1068 | echo ${UNAME_MACHINE}-pc-sysv32 1069 | fi 1070 | exit ;; 1071 | pc:*:*:*) 1072 | # Left here for compatibility: 1073 | # uname -m prints for DJGPP always 'pc', but it prints nothing about 1074 | # the processor, so we play safe by assuming i586. 1075 | # Note: whatever this is, it MUST be the same as what config.sub 1076 | # prints for the "djgpp" host, or else GDB configury will decide that 1077 | # this is a cross-build. 1078 | echo i586-pc-msdosdjgpp 1079 | exit ;; 1080 | Intel:Mach:3*:*) 1081 | echo i386-pc-mach3 1082 | exit ;; 1083 | paragon:*:*:*) 1084 | echo i860-intel-osf1 1085 | exit ;; 1086 | i860:*:4.*:*) # i860-SVR4 1087 | if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 1088 | echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 1089 | else # Add other i860-SVR4 vendors below as they are discovered. 1090 | echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 1091 | fi 1092 | exit ;; 1093 | mini*:CTIX:SYS*5:*) 1094 | # "miniframe" 1095 | echo m68010-convergent-sysv 1096 | exit ;; 1097 | mc68k:UNIX:SYSTEM5:3.51m) 1098 | echo m68k-convergent-sysv 1099 | exit ;; 1100 | M680?0:D-NIX:5.3:*) 1101 | echo m68k-diab-dnix 1102 | exit ;; 1103 | M68*:*:R3V[5678]*:*) 1104 | test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 1105 | 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) 1106 | OS_REL='' 1107 | test -r /etc/.relid \ 1108 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1109 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1110 | && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1111 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1112 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1113 | 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 1114 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1115 | && { echo i486-ncr-sysv4; exit; } ;; 1116 | NCR*:*:4.2:* | MPRAS*:*:4.2:*) 1117 | OS_REL='.3' 1118 | test -r /etc/.relid \ 1119 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1120 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1121 | && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1122 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1123 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } 1124 | /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 1125 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1126 | m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1127 | echo m68k-unknown-lynxos${UNAME_RELEASE} 1128 | exit ;; 1129 | mc68030:UNIX_System_V:4.*:*) 1130 | echo m68k-atari-sysv4 1131 | exit ;; 1132 | TSUNAMI:LynxOS:2.*:*) 1133 | echo sparc-unknown-lynxos${UNAME_RELEASE} 1134 | exit ;; 1135 | rs6000:LynxOS:2.*:*) 1136 | echo rs6000-unknown-lynxos${UNAME_RELEASE} 1137 | exit ;; 1138 | PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 1139 | echo powerpc-unknown-lynxos${UNAME_RELEASE} 1140 | exit ;; 1141 | SM[BE]S:UNIX_SV:*:*) 1142 | echo mips-dde-sysv${UNAME_RELEASE} 1143 | exit ;; 1144 | RM*:ReliantUNIX-*:*:*) 1145 | echo mips-sni-sysv4 1146 | exit ;; 1147 | RM*:SINIX-*:*:*) 1148 | echo mips-sni-sysv4 1149 | exit ;; 1150 | *:SINIX-*:*:*) 1151 | if uname -p 2>/dev/null >/dev/null ; then 1152 | UNAME_MACHINE=`(uname -p) 2>/dev/null` 1153 | echo ${UNAME_MACHINE}-sni-sysv4 1154 | else 1155 | echo ns32k-sni-sysv 1156 | fi 1157 | exit ;; 1158 | PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1159 | # says 1160 | echo i586-unisys-sysv4 1161 | exit ;; 1162 | *:UNIX_System_V:4*:FTX*) 1163 | # From Gerald Hewes . 1164 | # How about differentiating between stratus architectures? -djm 1165 | echo hppa1.1-stratus-sysv4 1166 | exit ;; 1167 | *:*:*:FTX*) 1168 | # From seanf@swdc.stratus.com. 1169 | echo i860-stratus-sysv4 1170 | exit ;; 1171 | i*86:VOS:*:*) 1172 | # From Paul.Green@stratus.com. 1173 | echo ${UNAME_MACHINE}-stratus-vos 1174 | exit ;; 1175 | *:VOS:*:*) 1176 | # From Paul.Green@stratus.com. 1177 | echo hppa1.1-stratus-vos 1178 | exit ;; 1179 | mc68*:A/UX:*:*) 1180 | echo m68k-apple-aux${UNAME_RELEASE} 1181 | exit ;; 1182 | news*:NEWS-OS:6*:*) 1183 | echo mips-sony-newsos6 1184 | exit ;; 1185 | R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1186 | if [ -d /usr/nec ]; then 1187 | echo mips-nec-sysv${UNAME_RELEASE} 1188 | else 1189 | echo mips-unknown-sysv${UNAME_RELEASE} 1190 | fi 1191 | exit ;; 1192 | BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1193 | echo powerpc-be-beos 1194 | exit ;; 1195 | BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1196 | echo powerpc-apple-beos 1197 | exit ;; 1198 | BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1199 | echo i586-pc-beos 1200 | exit ;; 1201 | BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1202 | echo i586-pc-haiku 1203 | exit ;; 1204 | SX-4:SUPER-UX:*:*) 1205 | echo sx4-nec-superux${UNAME_RELEASE} 1206 | exit ;; 1207 | SX-5:SUPER-UX:*:*) 1208 | echo sx5-nec-superux${UNAME_RELEASE} 1209 | exit ;; 1210 | SX-6:SUPER-UX:*:*) 1211 | echo sx6-nec-superux${UNAME_RELEASE} 1212 | exit ;; 1213 | SX-7:SUPER-UX:*:*) 1214 | echo sx7-nec-superux${UNAME_RELEASE} 1215 | exit ;; 1216 | SX-8:SUPER-UX:*:*) 1217 | echo sx8-nec-superux${UNAME_RELEASE} 1218 | exit ;; 1219 | SX-8R:SUPER-UX:*:*) 1220 | echo sx8r-nec-superux${UNAME_RELEASE} 1221 | exit ;; 1222 | Power*:Rhapsody:*:*) 1223 | echo powerpc-apple-rhapsody${UNAME_RELEASE} 1224 | exit ;; 1225 | *:Rhapsody:*:*) 1226 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 1227 | exit ;; 1228 | *:Darwin:*:*) 1229 | UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 1230 | case $UNAME_PROCESSOR in 1231 | i386) 1232 | eval $set_cc_for_build 1233 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 1234 | if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1235 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 1236 | grep IS_64BIT_ARCH >/dev/null 1237 | then 1238 | UNAME_PROCESSOR="x86_64" 1239 | fi 1240 | fi ;; 1241 | unknown) UNAME_PROCESSOR=powerpc ;; 1242 | esac 1243 | echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 1244 | exit ;; 1245 | *:procnto*:*:* | *:QNX:[0123456789]*:*) 1246 | UNAME_PROCESSOR=`uname -p` 1247 | if test "$UNAME_PROCESSOR" = "x86"; then 1248 | UNAME_PROCESSOR=i386 1249 | UNAME_MACHINE=pc 1250 | fi 1251 | echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 1252 | exit ;; 1253 | *:QNX:*:4*) 1254 | echo i386-pc-qnx 1255 | exit ;; 1256 | NEO-?:NONSTOP_KERNEL:*:*) 1257 | echo neo-tandem-nsk${UNAME_RELEASE} 1258 | exit ;; 1259 | NSE-?:NONSTOP_KERNEL:*:*) 1260 | echo nse-tandem-nsk${UNAME_RELEASE} 1261 | exit ;; 1262 | NSR-?:NONSTOP_KERNEL:*:*) 1263 | echo nsr-tandem-nsk${UNAME_RELEASE} 1264 | exit ;; 1265 | *:NonStop-UX:*:*) 1266 | echo mips-compaq-nonstopux 1267 | exit ;; 1268 | BS2000:POSIX*:*:*) 1269 | echo bs2000-siemens-sysv 1270 | exit ;; 1271 | DS/*:UNIX_System_V:*:*) 1272 | echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 1273 | exit ;; 1274 | *:Plan9:*:*) 1275 | # "uname -m" is not consistent, so use $cputype instead. 386 1276 | # is converted to i386 for consistency with other x86 1277 | # operating systems. 1278 | if test "$cputype" = "386"; then 1279 | UNAME_MACHINE=i386 1280 | else 1281 | UNAME_MACHINE="$cputype" 1282 | fi 1283 | echo ${UNAME_MACHINE}-unknown-plan9 1284 | exit ;; 1285 | *:TOPS-10:*:*) 1286 | echo pdp10-unknown-tops10 1287 | exit ;; 1288 | *:TENEX:*:*) 1289 | echo pdp10-unknown-tenex 1290 | exit ;; 1291 | KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1292 | echo pdp10-dec-tops20 1293 | exit ;; 1294 | XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1295 | echo pdp10-xkl-tops20 1296 | exit ;; 1297 | *:TOPS-20:*:*) 1298 | echo pdp10-unknown-tops20 1299 | exit ;; 1300 | *:ITS:*:*) 1301 | echo pdp10-unknown-its 1302 | exit ;; 1303 | SEI:*:*:SEIUX) 1304 | echo mips-sei-seiux${UNAME_RELEASE} 1305 | exit ;; 1306 | *:DragonFly:*:*) 1307 | echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 1308 | exit ;; 1309 | *:*VMS:*:*) 1310 | UNAME_MACHINE=`(uname -p) 2>/dev/null` 1311 | case "${UNAME_MACHINE}" in 1312 | A*) echo alpha-dec-vms ; exit ;; 1313 | I*) echo ia64-dec-vms ; exit ;; 1314 | V*) echo vax-dec-vms ; exit ;; 1315 | esac ;; 1316 | *:XENIX:*:SysV) 1317 | echo i386-pc-xenix 1318 | exit ;; 1319 | i*86:skyos:*:*) 1320 | echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 1321 | exit ;; 1322 | i*86:rdos:*:*) 1323 | echo ${UNAME_MACHINE}-pc-rdos 1324 | exit ;; 1325 | i*86:AROS:*:*) 1326 | echo ${UNAME_MACHINE}-pc-aros 1327 | exit ;; 1328 | x86_64:VMkernel:*:*) 1329 | echo ${UNAME_MACHINE}-unknown-esx 1330 | exit ;; 1331 | esac 1332 | 1333 | #echo '(No uname command or uname output not recognized.)' 1>&2 1334 | #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 1335 | 1336 | eval $set_cc_for_build 1337 | cat >$dummy.c < 1340 | # include 1341 | #endif 1342 | main () 1343 | { 1344 | #if defined (sony) 1345 | #if defined (MIPSEB) 1346 | /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 1347 | I don't know.... */ 1348 | printf ("mips-sony-bsd\n"); exit (0); 1349 | #else 1350 | #include 1351 | printf ("m68k-sony-newsos%s\n", 1352 | #ifdef NEWSOS4 1353 | "4" 1354 | #else 1355 | "" 1356 | #endif 1357 | ); exit (0); 1358 | #endif 1359 | #endif 1360 | 1361 | #if defined (__arm) && defined (__acorn) && defined (__unix) 1362 | printf ("arm-acorn-riscix\n"); exit (0); 1363 | #endif 1364 | 1365 | #if defined (hp300) && !defined (hpux) 1366 | printf ("m68k-hp-bsd\n"); exit (0); 1367 | #endif 1368 | 1369 | #if defined (NeXT) 1370 | #if !defined (__ARCHITECTURE__) 1371 | #define __ARCHITECTURE__ "m68k" 1372 | #endif 1373 | int version; 1374 | version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 1375 | if (version < 4) 1376 | printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 1377 | else 1378 | printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 1379 | exit (0); 1380 | #endif 1381 | 1382 | #if defined (MULTIMAX) || defined (n16) 1383 | #if defined (UMAXV) 1384 | printf ("ns32k-encore-sysv\n"); exit (0); 1385 | #else 1386 | #if defined (CMU) 1387 | printf ("ns32k-encore-mach\n"); exit (0); 1388 | #else 1389 | printf ("ns32k-encore-bsd\n"); exit (0); 1390 | #endif 1391 | #endif 1392 | #endif 1393 | 1394 | #if defined (__386BSD__) 1395 | printf ("i386-pc-bsd\n"); exit (0); 1396 | #endif 1397 | 1398 | #if defined (sequent) 1399 | #if defined (i386) 1400 | printf ("i386-sequent-dynix\n"); exit (0); 1401 | #endif 1402 | #if defined (ns32000) 1403 | printf ("ns32k-sequent-dynix\n"); exit (0); 1404 | #endif 1405 | #endif 1406 | 1407 | #if defined (_SEQUENT_) 1408 | struct utsname un; 1409 | 1410 | uname(&un); 1411 | 1412 | if (strncmp(un.version, "V2", 2) == 0) { 1413 | printf ("i386-sequent-ptx2\n"); exit (0); 1414 | } 1415 | if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 1416 | printf ("i386-sequent-ptx1\n"); exit (0); 1417 | } 1418 | printf ("i386-sequent-ptx\n"); exit (0); 1419 | 1420 | #endif 1421 | 1422 | #if defined (vax) 1423 | # if !defined (ultrix) 1424 | # include 1425 | # if defined (BSD) 1426 | # if BSD == 43 1427 | printf ("vax-dec-bsd4.3\n"); exit (0); 1428 | # else 1429 | # if BSD == 199006 1430 | printf ("vax-dec-bsd4.3reno\n"); exit (0); 1431 | # else 1432 | printf ("vax-dec-bsd\n"); exit (0); 1433 | # endif 1434 | # endif 1435 | # else 1436 | printf ("vax-dec-bsd\n"); exit (0); 1437 | # endif 1438 | # else 1439 | printf ("vax-dec-ultrix\n"); exit (0); 1440 | # endif 1441 | #endif 1442 | 1443 | #if defined (alliant) && defined (i860) 1444 | printf ("i860-alliant-bsd\n"); exit (0); 1445 | #endif 1446 | 1447 | exit (1); 1448 | } 1449 | EOF 1450 | 1451 | $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && 1452 | { echo "$SYSTEM_NAME"; exit; } 1453 | 1454 | # Apollos put the system type in the environment. 1455 | 1456 | test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } 1457 | 1458 | # Convex versions that predate uname can use getsysinfo(1) 1459 | 1460 | if [ -x /usr/convex/getsysinfo ] 1461 | then 1462 | case `getsysinfo -f cpu_type` in 1463 | c1*) 1464 | echo c1-convex-bsd 1465 | exit ;; 1466 | c2*) 1467 | if getsysinfo -f scalar_acc 1468 | then echo c32-convex-bsd 1469 | else echo c2-convex-bsd 1470 | fi 1471 | exit ;; 1472 | c34*) 1473 | echo c34-convex-bsd 1474 | exit ;; 1475 | c38*) 1476 | echo c38-convex-bsd 1477 | exit ;; 1478 | c4*) 1479 | echo c4-convex-bsd 1480 | exit ;; 1481 | esac 1482 | fi 1483 | 1484 | cat >&2 < in order to provide the needed 1498 | information to handle your system. 1499 | 1500 | config.guess timestamp = $timestamp 1501 | 1502 | uname -m = `(uname -m) 2>/dev/null || echo unknown` 1503 | uname -r = `(uname -r) 2>/dev/null || echo unknown` 1504 | uname -s = `(uname -s) 2>/dev/null || echo unknown` 1505 | uname -v = `(uname -v) 2>/dev/null || echo unknown` 1506 | 1507 | /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 1508 | /bin/uname -X = `(/bin/uname -X) 2>/dev/null` 1509 | 1510 | hostinfo = `(hostinfo) 2>/dev/null` 1511 | /bin/universe = `(/bin/universe) 2>/dev/null` 1512 | /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 1513 | /bin/arch = `(/bin/arch) 2>/dev/null` 1514 | /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 1515 | /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 1516 | 1517 | UNAME_MACHINE = ${UNAME_MACHINE} 1518 | UNAME_RELEASE = ${UNAME_RELEASE} 1519 | UNAME_SYSTEM = ${UNAME_SYSTEM} 1520 | UNAME_VERSION = ${UNAME_VERSION} 1521 | EOF 1522 | 1523 | exit 1 1524 | 1525 | # Local variables: 1526 | # eval: (add-hook 'write-file-hooks 'time-stamp) 1527 | # time-stamp-start: "timestamp='" 1528 | # time-stamp-format: "%:y-%02m-%02d" 1529 | # time-stamp-end: "'" 1530 | # End: 1531 | -------------------------------------------------------------------------------- /gcc.build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2014-2015 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | source build.conf 19 | 20 | if [[ ! -d toolsdir ]] ; 21 | then 22 | echo "You must first build the tools: run build_tools.bash" 23 | exit 1 24 | fi 25 | 26 | cd toolsdir/bin 27 | TOOLS_BIN_PATH=`pwd` 28 | cd - 29 | 30 | export PATH="$TOOLS_BIN_PATH:$PATH" 31 | 32 | if [[ ! -f gmp-${GMP_VERSION}.tar.bz2 ]] ; 33 | then 34 | wget ${GMP_SOURCE} 35 | fi 36 | 37 | tar xf gmp-${GMP_VERSION}.tar.bz2 38 | 39 | if [[ ! -f mpfr-${MPFR_VERSION}.tar.bz2 ]] ; 40 | then 41 | wget ${MPFR_SOURCE} 42 | fi 43 | 44 | tar xf mpfr-${MPFR_VERSION}.tar.bz2 45 | 46 | if [[ ! -f mpc-${MPC_VERSION}.tar.gz ]] ; 47 | then 48 | wget ${MPC_SOURCE} 49 | fi 50 | 51 | tar xf mpc-${MPC_VERSION}.tar.gz 52 | 53 | if [[ ! -f gcc-7.3.0.tar.xz ]] ; 54 | then 55 | wget https://ftp.gnu.org/gnu/gcc/gcc-7.3.0/gcc-7.3.0.tar.xz 56 | fi 57 | 58 | tar xf gcc-7.3.0.tar.xz 59 | mv gcc-7.3.0 gcc 60 | 61 | # Apply the right patchset 62 | cd gcc && patch -p1 < ../avr-gcc-patches/atmel-patches-gcc.7.3.0-arduino2.patch && cd .. 63 | 64 | #pushd gcc 65 | #pushd gcc/config/avr/ 66 | #sh genopt.sh avr-mcus.def > avr-tables.opt 67 | #cat avr-mcus.def | awk -f genmultilib.awk FORMAT="Makefile" > t-multilib 68 | #popd 69 | #pushd gcc 70 | #for p in ../../avr-gcc-patches/*.patch 71 | #do 72 | # echo Applying $p 73 | # patch -p1 < $p 74 | #done 75 | #autoconf 76 | #popd 77 | #popd 78 | 79 | mv gmp-${GMP_VERSION} gcc/gmp 80 | mv mpfr-${MPFR_VERSION} gcc/mpfr 81 | mv mpc-${MPC_VERSION} gcc/mpc 82 | 83 | mkdir -p objdir 84 | cd objdir 85 | PREFIX=`pwd` 86 | cd - 87 | 88 | if [[ x$CROSS_COMPILE != x ]] ; then 89 | EXTRA_CONFARGS="--host=$OUTPUT_TAG" 90 | fi 91 | 92 | mkdir -p gcc-build 93 | cd gcc-build 94 | 95 | CONFARGS=" \ 96 | --enable-fixed-point \ 97 | --enable-languages=c,c++ \ 98 | --prefix=$PREFIX \ 99 | --disable-nls \ 100 | --disable-libssp \ 101 | --disable-libada \ 102 | --disable-shared \ 103 | --with-avrlibc=yes \ 104 | --with-dwarf2 \ 105 | --disable-doc \ 106 | --target=avr" 107 | 108 | CFLAGS="-w -O2 -g0 $CFLAGS" CXXFLAGS="-w -O2 -g0 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ../gcc/configure $CONFARGS $EXTRA_CONFARGS 109 | 110 | if [ -z "$MAKE_JOBS" ]; then 111 | MAKE_JOBS="2" 112 | fi 113 | 114 | nice -n 10 make -j $MAKE_JOBS 115 | 116 | make install 117 | 118 | -------------------------------------------------------------------------------- /gdb.build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2014-2015 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | source build.conf 19 | 20 | if [[ ! -d toolsdir ]] ; 21 | then 22 | echo "You must first build the tools: run tools.bash" 23 | exit 1 24 | fi 25 | 26 | cd toolsdir/bin 27 | TOOLS_BIN_PATH=`pwd` 28 | cd - 29 | 30 | if [[ x$CROSS_COMPILE != x ]] ; then 31 | EXTRA_CONFARGS="--host=$OUTPUT_TAG" 32 | fi 33 | 34 | export PATH="$TOOLS_BIN_PATH:$PATH" 35 | 36 | if [[ ! -f avr-gdb.tar.bz2 ]] ; 37 | then 38 | wget $AVR_SOURCES/avr-gdb.tar.bz2 39 | fi 40 | 41 | tar xf avr-gdb.tar.bz2 42 | 43 | cd gdb 44 | for p in ../avr-gdb-patches/*.patch 45 | do 46 | echo Applying $p 47 | patch -p1 < $p 48 | done 49 | cd - 50 | 51 | mkdir -p objdir 52 | cd objdir 53 | PREFIX=`pwd` 54 | cd - 55 | 56 | mkdir -p gdb-build 57 | cd gdb-build 58 | 59 | CONFARGS=" \ 60 | --prefix=$PREFIX \ 61 | --disable-nls \ 62 | --disable-werror \ 63 | --with-guile=guile-2.0 \ 64 | --disable-binutils \ 65 | --target=avr" 66 | 67 | CFLAGS="-w -O2 -g0 $CFLAGS" CXXFLAGS="-w -O2 -g0 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ../gdb/configure $CONFARGS $EXTRA_CONFARGS 68 | 69 | if [ -z "$MAKE_JOBS" ]; then 70 | MAKE_JOBS="2" 71 | fi 72 | 73 | nice -n 10 make -j $MAKE_JOBS 74 | 75 | # New versions of gdb share the same configure/make scripts with binutils. Running make install-gdb to 76 | # install just the gdb binaries. 77 | make install-gdb 78 | 79 | -------------------------------------------------------------------------------- /package-avr-gcc.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2014-2016 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | source build.conf 19 | 20 | OUTPUT_VERSION=${GCC_VERSION}-atmel${AVR_VERSION}-${BUILD_NUMBER} 21 | 22 | export OS=`uname -o || uname` 23 | export TARGET_OS=$OS 24 | 25 | if [[ $CROSS_COMPILE == "mingw" ]] ; then 26 | 27 | export CC="i686-w64-mingw32-gcc" 28 | export CXX="i686-w64-mingw32-g++" 29 | export CROSS_COMPILE_HOST="i686-w64-mingw32" 30 | export TARGET_OS="Windows" 31 | export OUTPUT_TAG=i686-w64-mingw32 32 | 33 | elif [[ $CROSS_COMPILE == "osxcross" ]] ; then 34 | 35 | export CC="o32-clang" 36 | export CXX="o32-clang++" 37 | export CROSS_COMPILE_HOST="i386-apple-darwin13" 38 | export TARGET_OS="OSX" 39 | export OUTPUT_TAG=i386-apple-darwin13 40 | 41 | elif [[ $CROSS_COMPILE == "arm-cross" ]] ; then 42 | 43 | export CC="arm-linux-gnueabihf-gcc" 44 | export CXX="arm-linux-gnueabihf-g++" 45 | export CROSS_COMPILE_HOST="arm-linux-gnueabihf" 46 | export TARGET_OS="LinuxARM" 47 | export OUTPUT_TAG=arm-linux-gnueabihf 48 | 49 | elif [[ $OS == "GNU/Linux" ]] ; then 50 | 51 | export MACHINE=`uname -m` 52 | if [[ $MACHINE == "x86_64" ]] ; then 53 | OUTPUT_TAG=x86_64-pc-linux-gnu 54 | elif [[ $MACHINE == "i686" ]] ; then 55 | OUTPUT_TAG=i686-pc-linux-gnu 56 | elif [[ $MACHINE == "armv7l" ]] ; then 57 | OUTPUT_TAG=armhf-pc-linux-gnu 58 | elif [[ $MACHINE == "aarch64" ]] ; then 59 | OUTPUT_TAG=aarch64-pc-linux-gnu 60 | else 61 | echo Linux Machine not supported: $MACHINE 62 | exit 1 63 | fi 64 | 65 | elif [[ $OS == "Msys" || $OS == "Cygwin" ]] ; then 66 | 67 | export PATH=$PATH:/c/MinGW/bin/:/c/cygwin/bin/ 68 | export CC="mingw32-gcc -m32" 69 | export CXX="mingw32-g++ -m32" 70 | export CFLAGS="-DWIN32 -D__USE_MINGW_ACCESS" 71 | export CXXFLAGS="-DWIN32" 72 | export LDFLAGS="-DWIN32" 73 | export MAKE_JOBS=1 74 | OUTPUT_TAG=i686-mingw32 75 | 76 | elif [[ $OS == "Darwin" ]] ; then 77 | 78 | export PATH=/opt/local/libexec/gnubin/:/opt/local/bin:$PATH 79 | export CC="gcc -arch x86_64 -mmacosx-version-min=10.8" 80 | export CXX="g++ -arch x86_64 -mmacosx-version-min=10.8" 81 | OUTPUT_TAG=x86_64-apple-darwin14 82 | 83 | else 84 | 85 | echo OS Not supported: $OS 86 | exit 2 87 | 88 | fi 89 | 90 | rm -rf autoconf-${AUTOCONF_VERSION} automake-${AUTOMAKE_VERSION} 91 | rm -rf gcc gmp-${GMP_VERSION} mpc-${MPC_VERSION} mpfr-${MPFR_VERSION} binutils avr-libc libc avr8-headers gdb 92 | rm -rf toolsdir objdir *-build 93 | 94 | ./tools.bash 95 | ./binutils.build.bash 96 | ./gcc.build.bash 97 | ./avr-libc.build.bash 98 | ./gdb.build.bash 99 | 100 | rm -rf objdir/{info,man,share} 101 | 102 | ${BASH} ./atpack.build.bash 103 | ${BASH} ./atpack.tiny.build.bash 104 | ${BASH} ./atpack.Dx.build.bash 105 | 106 | 107 | # if producing a windows build, compress as zip and 108 | # copy *toolchain-precompiled* content to any folder containing a .exe 109 | if [[ ${OUTPUT_TAG} == *"mingw"* ]] ; then 110 | 111 | rm -f avr-gcc-${OUTPUT_VERSION}-${OUTPUT_TAG}.zip 112 | mv objdir avr 113 | BINARY_FOLDERS=`find avr -name *.exe -print0 | xargs -0 -n1 dirname | sort --unique` 114 | echo $BINARY_FOLDERS | xargs -n1 cp toolchain-precompiled/* 115 | zip -r avr-gcc-${OUTPUT_VERSION}-${OUTPUT_TAG}.zip avr 116 | mv avr objdir 117 | 118 | else 119 | 120 | rm -f avr-gcc-${OUTPUT_VERSION}-${OUTPUT_TAG}.tar.bz2 121 | mv objdir avr 122 | tar -cjvf avr-gcc-${OUTPUT_VERSION}-${OUTPUT_TAG}.tar.bz2 avr 123 | mv avr objdir 124 | 125 | fi 126 | -------------------------------------------------------------------------------- /toolchain-precompiled/libiconv-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/toolchain-avr/HEAD/toolchain-precompiled/libiconv-2.dll -------------------------------------------------------------------------------- /toolchain-precompiled/libwinpthread-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/toolchain-avr/HEAD/toolchain-precompiled/libwinpthread-1.dll -------------------------------------------------------------------------------- /tools.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2014-2015 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | source build.conf 19 | 20 | mkdir -p toolsdir/bin 21 | cd toolsdir 22 | TOOLS_PATH=`pwd` 23 | cd bin 24 | TOOLS_BIN_PATH=`pwd` 25 | cd ../../ 26 | 27 | export PATH="$TOOLS_BIN_PATH:$PATH" 28 | 29 | if [ -z "$MAKE_JOBS" ]; then 30 | MAKE_JOBS="2" 31 | fi 32 | 33 | if [[ ! -f autoconf-${AUTOCONF_VERSION}.tar.bz2 ]] ; 34 | then 35 | wget $AUTOCONF_SOURCE 36 | fi 37 | 38 | tar xfjv autoconf-${AUTOCONF_VERSION}.tar.bz2 39 | 40 | cd autoconf-${AUTOCONF_VERSION} 41 | 42 | CONFARGS="--prefix=$TOOLS_PATH" 43 | 44 | ./configure $CONFARGS 45 | 46 | nice -n 10 make -j $MAKE_JOBS 47 | 48 | make install 49 | 50 | cd - 51 | 52 | if [[ ! -f automake-${AUTOMAKE_VERSION}.tar.bz2 ]] ; 53 | then 54 | wget $AUTOMAKE_SOURCE 55 | fi 56 | 57 | tar xfjv automake-${AUTOMAKE_VERSION}.tar.bz2 58 | 59 | cd automake-${AUTOMAKE_VERSION} 60 | 61 | patch -p1 < ../automake-patches/0001-fix-perl-522.patch 62 | 63 | cp ../config.guess-am-1.11.4 lib/config.guess 64 | ./bootstrap 65 | 66 | CONFARGS="--prefix=$TOOLS_PATH" 67 | 68 | ./configure $CONFARGS 69 | 70 | # Prevent compilation problem with docs complaining about @itemx not following @item 71 | cp doc/automake.texi doc/automake.texi2 72 | cat doc/automake.texi2 | $SED -r 's/@itemx/@c @itemx/' >doc/automake.texi 73 | rm doc/automake.texi2 74 | 75 | nice -n 10 make -j $MAKE_JOBS 76 | 77 | make install 78 | 79 | cd - 80 | 81 | --------------------------------------------------------------------------------