手機 - Gemini PDA 4G - Android - Termux - Build AVR binutils 2.31



步驟如下:

$ cd
$ wget https://ftp.gnu.org/gnu/binutils/binutils-2.31.tar.gz
$ tar xvf binutils-2.31.tar.gz
$ cd binutils-2.31
$ vim bfd/configure +16081
    #for ac_func in ftello ftello64 fseeko fseeko64 fopen64
    for ac_func in ftello fseeko

$ ./configure --target=avr --prefix=$PREFIX
$ make
$ make install
$ avr-as --help
    Segmentation fault

$ gdb --args avr-as --help

(gdb) run
    Starting program: /data/data/com.termux/files/usr/bin/avr-as --help

    Program received signal SIGSEGV, Segmentation fault.
    libintl_dcigettext (domainname=0x7fb782c0f8 "gas", msgid1=0x55556326af "Usage: %s [option...] [asmfile...]\n",
      msgid2=<optimized out>, plural=<optimized out>, n=0, category=5) at dcigettext.c:574                                        574
        stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),

(gdb) quit

$ vim intl/dcigettext.c +574
   //stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
   //               domainname, domainname_len),
   //       ".mo");
   sprintf(xdomainname, "%s/%s.mo", categoryname, domainname);

$ make
$ make install
$ avr-as --help
    Usage: avr-as [option...] [asmfile...]
    Options:
      -a[sub-option...]	  turn on listings
                              Sub-options [default hls]:
                              c      omit false conditionals
                              d      omit debugging directives
                              g      include general info
                              h      include high-level source
                              l      include assembly
                              m      include macro expansions
                              n      omit forms processing
                              s      include symbols
                              =FILE  list to FILE (must be last sub-option)
      --alternate             initially turn on alternate macro syntax
      --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi}]
                              compress DWARF debug sections using zlib
      --nocompress-debug-sections
                              don't compress DWARF debug sections [default]
      -D                      produce assembler debugging messages
      --debug-prefix-map OLD=NEW
                              map OLD to NEW in debug information
      --defsym SYM=VAL        define symbol SYM to given value
      --execstack             require executable stack for this object
      --noexecstack           don't require executable stack for this object
      --size-check=[error|warning]
                  ELF .size directive check (default --size-check=error)
      --elf-stt-common=[no|yes]
                              generate ELF common symbols with STT_COMMON type
      --sectname-subst        enable section name substitution sequences
      --generate-missing-build-notes=[no|yes] (default: no)
                              generate GNU Build notes if none are present in the input
      -f                      skip whitespace and comment preprocessing
      -g --gen-debug          generate debugging information
      --gstabs                generate STABS debugging information
      --gstabs+               generate STABS debug info with GNU extensions
      --gdwarf-2              generate DWARF2 debugging information
      --gdwarf-sections       generate per-function section names for DWARF line information
      --hash-size=&lt;value&gt;     set the hash table size close to &lt;value&gt;
      --help                  show this message and exit
      --target-help           show target specific options
      -I DIR                  add DIR to search list for .include directives
      -J                      don't warn about signed overflow
      -K                      warn when differences altered for long displacements
      -L,--keep-locals        keep local symbols (e.g. starting with `L')
      -M,--mri                assemble in MRI compatibility mode
      --MD FILE               write dependency information in FILE (default none)
      -nocpp                  ignored
      -no-pad-sections        do not pad the end of sections to alignment boundaries
      -o OBJFILE              name the object-file output OBJFILE (default a.out)
      -R                      fold data section into text section
      --reduce-memory-overheads 
                              prefer smaller memory use at the cost of longer
                              assembly times
      --statistics            print various measured statistics from execution
      --strip-local-absolute  strip local absolute symbols
      --traditional-format    Use same format as native assembler when possible
      --version               print assembler version number and exit
      -W  --no-warn           suppress warnings
      --warn                  don't suppress warnings
      --fatal-warnings        treat warnings as errors
      -w                      ignored
      -X                      ignored
      -Z                      generate object file even after errors
      --listing-lhs-width     set the width in words of the output data column of
                              the listing
      --listing-lhs-width2    set the width in words of the continuation lines
                              of the output data column; ignored if smaller than
                              the width of the first line
      --listing-rhs-width     set the max width in characters of the lines from
                              the source file
      --listing-cont-lines    set the maximum number of continuation lines used
                              for the output data column of the listing
      @FILE                   read options from FILE
    AVR Assembler options:
      -mmcu=[avr-name] select microcontroller variant
                       [avr-name] can be:
                       avr1  - classic AVR core without data RAM
                       avr2  - classic AVR core with up to 8K program memory
                       avr25 - classic AVR core with up to 8K program memory
                               plus the MOVW instruction
                       avr3  - classic AVR core with up to 64K program memory
                       avr31 - classic AVR core with up to 128K program memory
                       avr35 - classic AVR core with up to 64K program memory
                               plus the MOVW instruction
                       avr4  - enhanced AVR core with up to 8K program memory
                       avr5  - enhanced AVR core with up to 64K program memory
                       avr51 - enhanced AVR core with up to 128K program memory
                       avr6  - enhanced AVR core with up to 256K program memory
                       avrxmega2 - XMEGA, > 8K, < 64K FLASH, < 64K RAM
                       avrxmega3 - XMEGA, RAM + FLASH < 64K, Flash visible in RAM
                       avrxmega4 - XMEGA, > 64K, <= 128K FLASH, <= 64K RAM
                       avrxmega5 - XMEGA, > 64K, <= 128K FLASH, > 64K RAM
                       avrxmega6 - XMEGA, > 128K, <= 256K FLASH, <= 64K RAM
                       avrxmega7 - XMEGA, > 128K, <= 256K FLASH, > 64K RAM
                       avrtiny   - AVR Tiny core with 16 gp registers
      -mall-opcodes    accept all AVR opcodes, even if not supported by MCU
      -mno-skip-bug    disable warnings for skipping two-word instructions
                       (default for avr4, avr5)
      -mno-wrap        reject rjmp/rcall instructions with 8K wrap-around
                       (default for avr3, avr5)
      -mrmw            accept Read-Modify-Write instructions
      -mlink-relax     generate relocations for linker relaxation (default)
      -mno-link-relax  don't generate relocations for linker relaxation.
      -mgcc-isr        accept the __gcc_isr pseudo-instruction.
    Known MCU names:
      avr1 avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1
      avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny
      at90s1200 attiny11 attiny12 attiny15 attiny28 at90s2313 at90s2323
      at90s2333 at90s2343 attiny22 attiny26 at90s4414 at90s4433 at90s4434
      at90s8515 at90c8534 at90s8535 ata5272 attiny13 attiny13a attiny2313
      attiny2313a attiny24 attiny24a attiny4313 attiny44 attiny44a attiny84
      attiny84a attiny25 attiny45 attiny85 attiny261 attiny261a attiny461
      attiny461a attiny861 attiny861a attiny87 attiny43u attiny48 attiny88
      attiny828 at86rf401 at43usb355 at76c711 atmega103 at43usb320 attiny167
      at90usb82 at90usb162 ata5505 atmega8u2 atmega16u2 atmega32u2 attiny1634
      atmega8 ata6289 atmega8a ata6285 ata6286 atmega48 atmega48a atmega48pa
      atmega48p atmega88 atmega88a atmega88p atmega88pa atmega8515 atmega8535
      atmega8hva at90pwm1 at90pwm2 at90pwm2b at90pwm3 at90pwm3b at90pwm81
      at90pwm161 ata5790 ata5795 atmega16 atmega16a atmega161 atmega162
      atmega163 atmega164a atmega164p atmega164pa atmega165 atmega165a
      atmega165p atmega165pa atmega168 atmega168a atmega168p atmega168pa
      atmega169 atmega169a atmega169p atmega169pa atmega32 atmega32a atmega323
      atmega324a atmega324p atmega324pa atmega325 atmega325a atmega325p
      atmega325pa atmega3250 atmega3250a atmega3250p atmega3250pa atmega328
      atmega328p atmega329 atmega329a atmega329p atmega329pa atmega3290
      atmega3290a atmega3290p atmega3290pa atmega406 atmega64rfr2
      atmega644rfr2 atmega64 atmega64a atmega640 atmega644 atmega644a
      atmega644p atmega644pa atmega645 atmega645a atmega645p atmega649
      atmega649a atmega649p atmega6450 atmega6450a atmega6450p atmega6490
      atmega6490a atmega6490p atmega64rfr2 atmega644rfr2 atmega16hva
      atmega16hva2 atmega16hvb atmega16hvbrevb atmega32hvb atmega32hvbrevb
      atmega64hve at90can32 at90can64 at90pwm161 at90pwm216 at90pwm316
      atmega32c1 atmega64c1 atmega16m1 atmega32m1 atmega64m1 atmega16u4
      atmega32u4 atmega32u6 at90usb646 at90usb647 at90scr100 at94k m3000
      atmega128 atmega128a atmega1280 atmega1281 atmega1284 atmega1284p
      atmega128rfa1 atmega128rfr2 atmega1284rfr2 at90can128 at90usb1286
      at90usb1287 atmega2560 atmega2561 atmega256rfr2 atmega2564rfr2
      atxmega16a4 atxmega16a4u atxmega16c4 atxmega16d4 atxmega32a4
      atxmega32a4u atxmega32c4 atxmega32d4 atxmega32e5 atxmega16e5 atxmega8e5
      atxmega32x1 attiny212 attiny214 attiny412 attiny414 attiny416 attiny417
      attiny814 attiny816 attiny817 attiny1614 attiny1616 attiny1617
      attiny3214 attiny3216 attiny3217 atxmega64a3 atxmega64a3u atxmega64a4u
      atxmega64b1 atxmega64b3 atxmega64c3 atxmega64d3 atxmega64d4 atxmega64a1
      atxmega64a1u atxmega128a3 atxmega128a3u atxmega128b1 atxmega128b3
      atxmega128c3 atxmega128d3 atxmega128d4 atxmega192a3 atxmega192a3u
      atxmega192c3 atxmega192d3 atxmega256a3 atxmega256a3u atxmega256a3b
      atxmega256a3bu atxmega256c3 atxmega256d3 atxmega384c3 atxmega384d3
      atxmega128a1 atxmega128a1u atxmega128a4u attiny4 attiny5 attiny9
      attiny10 attiny20 attiny40

    Report bugs to &lt;http://www.sourceware.org/bugzilla/&gt;