[patch,avr]: Part5: Fix various problems with specs and specs file generation.

Denis Chertykov chertykov@gmail.com
Tue Mar 17 06:37:00 GMT 2015


2015-03-16 21:17 GMT+03:00 Georg-Johann Lay <avr@gjlay.de>:
> This patch introduces a new avr specific command option '-nodevicelib' so
> that linking of libdev.a can be bypassed.
>
> The argument of -specs= is suffixed by %s instead of supplying the absolute
> path.  That way -specs= works with installation path that contains spaces.
>
> avr_mct_t.library_name and its initializers in avr-mcus.def are cleaned up.
>
> This field was used to define __AVR_DEV_LIB_NAME__.  If no device macro is
> defined because a device is not supported by avr-gcc, that hook macro can be
> defined to tell avr/io.h where to find the device's header file.
>
> This means it is pointless to define __AVR_DEV_LIB_NAME__ in avr-gcc:
>
> If a device is supported, the device macro (e.g. __AVR_ATmega8__) is defined
> and __AVR_DEV_LIB_NAME__ will never be used.
>
> The patch adds more help text to the device specs file to inform a potential
> reader about the role of the hook macro __AVR_DEV_LIB_NAME__.
>
> The patch also removes specs known to GCC and which don't directly depend on
> the device from the device specs file.  This makes the specs file smaller
> and easier less confusing.
>
> Ok for trunk?
>
> Johann
>
>
>         PR target/65296
>         * config/avr/avrlibc.h (LIB_SPEC, LIBGCC_SPEC) [AVR1]: Don't link
>         libgcc.a, libc.a, libm.a.
>         * config/avr/specs.h: Same.
>         * config/avr/gen-avr-mmcu-specs.c (print_mcu): Don't print specs
>         which don't (directly) depend on the device.  Print more help.
>         (*avrlibc_devicelib) [-nodevicelib]: Don't link libdev.a.
>         (*cpp): Don't define __AVR_DEV_LIB_NAME__.
>         * config/avr/driver-avr.c: Remove -nodevicelib from option list in
>         case of an error.
>         (avr_devicespecs_file): Use suffix "%s" instead of absolute path.
>         for specs file name instead of absolute path.
>         * config/avr/avr-arch.h (avr_mcu_t) [.library_name]: Remove.
>         * config/avr/avr-mcus.def: Same: Adjust initializers.
>         * config/avr/avr.opt (-nodevicelib): New option.
>         * doc/invoke.texi (AVR Options): Document it.
>

Please apply.

Denis.



More information about the Gcc-patches mailing list