[MacPorts] #54529: ave-libc @1.8.1 and avr-gcc @7.1.0 compiles but does not link because crt* file names do not match contents of spec files (was: ave-libc and avr-gcc 7.1.0 compiles but does not link because crt* file names do not match contents of spec files)

MacPorts noreply at macports.org
Tue Jul 25 02:56:37 UTC 2017


#54529: ave-libc @1.8.1 and avr-gcc @7.1.0 compiles but does not link because crt*
file names do not match contents of spec files
----------------------------+-----------------
  Reporter:  wcontello-fti  |      Owner:
      Type:  defect         |     Status:  new
  Priority:  Normal         |  Milestone:
 Component:  ports          |    Version:
Resolution:                 |   Keywords:
      Port:  avr-libc       |
----------------------------+-----------------
Changes (by ryandesign):

 * cc: g5pw (added)
 * keywords:  avr-libc avr-gcc atmega16m1 atmega32m1 atmega64m1 =>
 * port:  avr-libc @1.8.1_0 => avr-libc


Old description:

> I am still working through this problem.  I have a project for an
> ATmeg64m1 that was compiling using a make file with avr-gcc 4.9.1.  After
> the update to 7.1.0 it fails because it cannot find the request crt file.
>
> I know it is locating the spec file because the messages in the log show
> the path for the library is "avr5":
> {{{
> .
> .
> .
> Target: avr
> Configured with: /opt/local/var/macports/build
> /_opt_bblocal_var_buildworker_ports_build_ports_cross_avr-gcc/avr-
> gcc/work/gcc-7.1.0/configure --prefix=/opt/local --target=avr
> --infodir=/opt/local/share/info --mandir=/opt/local/share/man
> --datarootdir=/opt/local/share/avr-gcc --with-system-zlib --with-
> gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --enable-
> stage1-checking --enable-multilib --enable-lto --enable-languages=c,c++
> Thread model: single
> gcc version 7.1.0 (GCC)
> COMPILER_PATH=/opt/local/libexec/gcc/avr/7.1.0/:/opt/local/libexec/gcc/avr/7.1.0/:/opt/local/libexec/gcc/avr/:/opt/local/lib/gcc/avr/7.1.0/:/opt/local/lib/gcc/avr/:/opt/local/lib/gcc/avr/7.1.0/../../../../avr/bin/
> LIBRARY_PATH=/opt/local/lib/gcc/avr/7.1.0/avr5/:/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/avr5/:/opt/local/lib/gcc/avr/7.1.0/:/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/
> COLLECT_GCC_OPTIONS='-std=gnu99' '-v' '-Wall' '-fdefer-pop' '-Os' '-D'
> 'EMBEDDED' '-D' 'atmega64m1' '-D' 'F_CPU=16000000UL'  '-ffreestanding'
> '-fverbose-asm' '-save-temps' '-o' 'main.elf' '-specs=device-specs/specs-
> atmega64m1' '-mmcu=avr5'
>  /opt/local/libexec/gcc/avr/7.1.0/collect2 -plugin
> /opt/local/libexec/gcc/avr/7.1.0/liblto_plugin.so -plugin-
> opt=/opt/local/libexec/gcc/avr/7.1.0/lto-wrapper -plugin-
> opt=-fresolution=AlphaFilter.res -plugin-opt=-pass-through=-lgcc -plugin-
> opt=-pass-through=-lm -plugin-opt=-pass-through=-lc -plugin-opt=-pass-
> through=-latmega64m1 -mavr5 -Tdata 0x800100 -o main.elf crtatmega64m1.o
> -L/opt/local/lib/gcc/avr/7.1.0/avr5
> -L/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/avr5
> -L/opt/local/lib/gcc/avr/7.1.0
> -L/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib --relax main.o util.o
> Timer0.o can.o SerialProc.o AlphaFilter.o --start-group -lgcc -lm -lc
> -latmega64m1 --end-group
> /opt/local/lib/gcc/avr/7.1.0/../../../../avr/bin/ld: cannot find
> crtatmega64m1.o: No such file or directory
> /opt/local/lib/gcc/avr/7.1.0/../../../../avr/bin/ld: cannot find
> -latmega64m1
> collect2: error: ld returned 1 exit status
> make: *** [main.elf] Error 1
> }}}
>
> The line:
> {{{
> /opt/local/lib/gcc/avr/7.1.0/../../../../avr/bin/ld: cannot find
> crtatmega64m1.o: No such file or directory
> }}}
>
> Indicates the linker cannot find the particular start file for my device.
>
> Then I look in the spec file "specs-atmega64m1", I see
> {{{
> .
> .
> .
> *avrlibc_startfile:
>         crtatmega16m1.o%s.
> .
> .
> }}}
>
> But the files are named:
> Proton:avr5 wayne$ ls -al *m1.o
> -rw-r--r--  1 wayne  wheel  10688 Jul 24 10:34 atmega32m1.o
> -rw-r--r--  1 root   wheel  10688 Jul 24 10:34 crtm16m1.o
> -rw-r--r--  1 root   wheel  10688 Jul 24 10:34 crtm32m1.o
> -rw-r--r--  1 root   wheel  10688 Jul 24 10:34 crtm64m1.o
> Proton:avr5 wayne$ pwd
> /opt/local/avr/lib/avr5
>

> if I rename the file "crt64m1.o" to "crtatmega64m1.o"  then I get a
> little further but there is still a problem:
>
> {{{
> .
> .
> .
> Target: avr
> Configured with: /opt/local/var/macports/build
> /_opt_bblocal_var_buildworker_ports_build_ports_cross_avr-gcc/avr-
> gcc/work/gcc-7.1.0/configure --prefix=/opt/local --target=avr
> --infodir=/opt/local/share/info --mandir=/opt/local/share/man
> --datarootdir=/opt/local/share/avr-gcc --with-system-zlib --with-
> gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --enable-
> stage1-checking --enable-multilib --enable-lto --enable-languages=c,c++
> Thread model: single
> gcc version 7.1.0 (GCC)
> COMPILER_PATH=/opt/local/libexec/gcc/avr/7.1.0/:/opt/local/libexec/gcc/avr/7.1.0/:/opt/local/libexec/gcc/avr/:/opt/local/lib/gcc/avr/7.1.0/:/opt/local/lib/gcc/avr/:/opt/local/lib/gcc/avr/7.1.0/../../../../avr/bin/
> LIBRARY_PATH=/opt/local/lib/gcc/avr/7.1.0/avr5/:/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/avr5/:/opt/local/lib/gcc/avr/7.1.0/:/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/
> COLLECT_GCC_OPTIONS='-std=gnu99' '-v' '-Wall' '-fdefer-pop' '-Os' '-D'
> 'EMBEDDED' '-D' 'atmega64m1' '-D' 'F_CPU=16000000UL'  '-ffreestanding'
> '-fverbose-asm' '-save-temps' '-o' 'main.elf' '-specs=device-specs/specs-
> atmega64m1' '-mmcu=avr5'
>  /opt/local/libexec/gcc/avr/7.1.0/collect2 -plugin
> /opt/local/libexec/gcc/avr/7.1.0/liblto_plugin.so -plugin-
> opt=/opt/local/libexec/gcc/avr/7.1.0/lto-wrapper -plugin-
> opt=-fresolution=AlphaFilter.res -plugin-opt=-pass-through=-lgcc -plugin-
> opt=-pass-through=-lm -plugin-opt=-pass-through=-lc -plugin-opt=-pass-
> through=-latmega64m1 -mavr5 -Tdata 0x800100 -o main.elf
> /opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/avr5/crtatmega64m1.o
> -L/opt/local/lib/gcc/avr/7.1.0/avr5
> -L/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/avr5
> -L/opt/local/lib/gcc/avr/7.1.0
> -L/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib --relax main.o util.o
> Timer0.o can.o SerialProc.o AlphaFilter.o --start-group -lgcc -lm -lc
> -latmega64m1 --end-group
> /opt/local/lib/gcc/avr/7.1.0/../../../../avr/bin/ld: cannot find
> -latmega64m1
> collect2: error: ld returned 1 exit status
> make: *** [main.elf] Error 1
> Command /usr/bin/make failed with exit code 2
> }}}
>
> This is because the same spec file indicates:
> {{{
> .
> .
> .
> *avrlibc_devicelib:
>         %{!nodevicelib:-latmega64m1}
> .
> .
> .
> }}}
>

> when I search on my machine for any file with this name I cannot find the
> file.
>
> {{{
> Proton:avr5 wayne$ sudo find /opt -name "*64m1*"
> /opt/local/avr/include/avr/iom64m1.h
> /opt/local/avr/lib/avr5/crtatmega64m1.o
> /opt/local/avr/lib/avr5/crtm64m1.o
> /opt/local/lib/gcc/avr/7.1.0/device-specs/specs-atmega64m1
> }}}
>
> note: The file "/opt/local/avr/lib/avr5/crtatmega64m1.o" is a copy of
> "/opt/local/avr/lib/avr5/crtm64m1.o" which I renamed.
>
> So right now I am stuck because I do not know where to find this file or
> what it should be changed to (if appropriate).

New description:

 I am still working through this problem.  I have a project for an
 ATmeg64m1 that was compiling using a make file with avr-gcc 4.9.1.  After
 the update to 7.1.0 it fails because it cannot find the request crt file.

 I know it is locating the spec file because the messages in the log show
 the path for the library is "avr5":
 {{{
 .
 .
 .
 Target: avr
 Configured with: /opt/local/var/macports/build
 /_opt_bblocal_var_buildworker_ports_build_ports_cross_avr-gcc/avr-
 gcc/work/gcc-7.1.0/configure --prefix=/opt/local --target=avr
 --infodir=/opt/local/share/info --mandir=/opt/local/share/man
 --datarootdir=/opt/local/share/avr-gcc --with-system-zlib --with-
 gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --enable-
 stage1-checking --enable-multilib --enable-lto --enable-languages=c,c++
 Thread model: single
 gcc version 7.1.0 (GCC)
 COMPILER_PATH=/opt/local/libexec/gcc/avr/7.1.0/:/opt/local/libexec/gcc/avr/7.1.0/:/opt/local/libexec/gcc/avr/:/opt/local/lib/gcc/avr/7.1.0/:/opt/local/lib/gcc/avr/:/opt/local/lib/gcc/avr/7.1.0/../../../../avr/bin/
 LIBRARY_PATH=/opt/local/lib/gcc/avr/7.1.0/avr5/:/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/avr5/:/opt/local/lib/gcc/avr/7.1.0/:/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/
 COLLECT_GCC_OPTIONS='-std=gnu99' '-v' '-Wall' '-fdefer-pop' '-Os' '-D'
 'EMBEDDED' '-D' 'atmega64m1' '-D' 'F_CPU=16000000UL'  '-ffreestanding'
 '-fverbose-asm' '-save-temps' '-o' 'main.elf' '-specs=device-specs/specs-
 atmega64m1' '-mmcu=avr5'
  /opt/local/libexec/gcc/avr/7.1.0/collect2 -plugin
 /opt/local/libexec/gcc/avr/7.1.0/liblto_plugin.so -plugin-
 opt=/opt/local/libexec/gcc/avr/7.1.0/lto-wrapper -plugin-
 opt=-fresolution=AlphaFilter.res -plugin-opt=-pass-through=-lgcc -plugin-
 opt=-pass-through=-lm -plugin-opt=-pass-through=-lc -plugin-opt=-pass-
 through=-latmega64m1 -mavr5 -Tdata 0x800100 -o main.elf crtatmega64m1.o
 -L/opt/local/lib/gcc/avr/7.1.0/avr5
 -L/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/avr5
 -L/opt/local/lib/gcc/avr/7.1.0
 -L/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib --relax main.o util.o
 Timer0.o can.o SerialProc.o AlphaFilter.o --start-group -lgcc -lm -lc
 -latmega64m1 --end-group
 /opt/local/lib/gcc/avr/7.1.0/../../../../avr/bin/ld: cannot find
 crtatmega64m1.o: No such file or directory
 /opt/local/lib/gcc/avr/7.1.0/../../../../avr/bin/ld: cannot find
 -latmega64m1
 collect2: error: ld returned 1 exit status
 make: *** [main.elf] Error 1
 }}}

 The line:
 {{{
 /opt/local/lib/gcc/avr/7.1.0/../../../../avr/bin/ld: cannot find
 crtatmega64m1.o: No such file or directory
 }}}

 Indicates the linker cannot find the particular start file for my device.

 Then I look in the spec file "specs-atmega64m1", I see
 {{{
 .
 .
 .
 *avrlibc_startfile:
         crtatmega16m1.o%s.
 .
 .
 }}}

 But the files are named:
 {{{
 Proton:avr5 wayne$ ls -al *m1.o
 -rw-r--r--  1 wayne  wheel  10688 Jul 24 10:34 atmega32m1.o
 -rw-r--r--  1 root   wheel  10688 Jul 24 10:34 crtm16m1.o
 -rw-r--r--  1 root   wheel  10688 Jul 24 10:34 crtm32m1.o
 -rw-r--r--  1 root   wheel  10688 Jul 24 10:34 crtm64m1.o
 Proton:avr5 wayne$ pwd
 /opt/local/avr/lib/avr5
 }}}

 if I rename the file "crt64m1.o" to "crtatmega64m1.o"  then I get a little
 further but there is still a problem:

 {{{
 .
 .
 .
 Target: avr
 Configured with: /opt/local/var/macports/build
 /_opt_bblocal_var_buildworker_ports_build_ports_cross_avr-gcc/avr-
 gcc/work/gcc-7.1.0/configure --prefix=/opt/local --target=avr
 --infodir=/opt/local/share/info --mandir=/opt/local/share/man
 --datarootdir=/opt/local/share/avr-gcc --with-system-zlib --with-
 gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --enable-
 stage1-checking --enable-multilib --enable-lto --enable-languages=c,c++
 Thread model: single
 gcc version 7.1.0 (GCC)
 COMPILER_PATH=/opt/local/libexec/gcc/avr/7.1.0/:/opt/local/libexec/gcc/avr/7.1.0/:/opt/local/libexec/gcc/avr/:/opt/local/lib/gcc/avr/7.1.0/:/opt/local/lib/gcc/avr/:/opt/local/lib/gcc/avr/7.1.0/../../../../avr/bin/
 LIBRARY_PATH=/opt/local/lib/gcc/avr/7.1.0/avr5/:/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/avr5/:/opt/local/lib/gcc/avr/7.1.0/:/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/
 COLLECT_GCC_OPTIONS='-std=gnu99' '-v' '-Wall' '-fdefer-pop' '-Os' '-D'
 'EMBEDDED' '-D' 'atmega64m1' '-D' 'F_CPU=16000000UL'  '-ffreestanding'
 '-fverbose-asm' '-save-temps' '-o' 'main.elf' '-specs=device-specs/specs-
 atmega64m1' '-mmcu=avr5'
  /opt/local/libexec/gcc/avr/7.1.0/collect2 -plugin
 /opt/local/libexec/gcc/avr/7.1.0/liblto_plugin.so -plugin-
 opt=/opt/local/libexec/gcc/avr/7.1.0/lto-wrapper -plugin-
 opt=-fresolution=AlphaFilter.res -plugin-opt=-pass-through=-lgcc -plugin-
 opt=-pass-through=-lm -plugin-opt=-pass-through=-lc -plugin-opt=-pass-
 through=-latmega64m1 -mavr5 -Tdata 0x800100 -o main.elf
 /opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/avr5/crtatmega64m1.o
 -L/opt/local/lib/gcc/avr/7.1.0/avr5
 -L/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib/avr5
 -L/opt/local/lib/gcc/avr/7.1.0
 -L/opt/local/lib/gcc/avr/7.1.0/../../../../avr/lib --relax main.o util.o
 Timer0.o can.o SerialProc.o AlphaFilter.o --start-group -lgcc -lm -lc
 -latmega64m1 --end-group
 /opt/local/lib/gcc/avr/7.1.0/../../../../avr/bin/ld: cannot find
 -latmega64m1
 collect2: error: ld returned 1 exit status
 make: *** [main.elf] Error 1
 Command /usr/bin/make failed with exit code 2
 }}}

 This is because the same spec file indicates:
 {{{
 .
 .
 .
 *avrlibc_devicelib:
         %{!nodevicelib:-latmega64m1}
 .
 .
 .
 }}}


 when I search on my machine for any file with this name I cannot find the
 file.

 {{{
 Proton:avr5 wayne$ sudo find /opt -name "*64m1*"
 /opt/local/avr/include/avr/iom64m1.h
 /opt/local/avr/lib/avr5/crtatmega64m1.o
 /opt/local/avr/lib/avr5/crtm64m1.o
 /opt/local/lib/gcc/avr/7.1.0/device-specs/specs-atmega64m1
 }}}

 note: The file "/opt/local/avr/lib/avr5/crtatmega64m1.o" is a copy of
 "/opt/local/avr/lib/avr5/crtm64m1.o" which I renamed.

 So right now I am stuck because I do not know where to find this file or
 what it should be changed to (if appropriate).

--

--
Ticket URL: <https://trac.macports.org/ticket/54529#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list