avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] device libs and spaces


From: Georg-Johann Lay
Subject: [avr-libc-dev] device libs and spaces
Date: Thu, 12 Mar 2015 00:04:37 +0100
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

avr-gcc adds the new device specific libraries like dev/atmega8/devlib.a by means if lib_spec, which is defined in the device specific specs file. Here an example for ATmega8:

*lib:
        -lc dev/atmega8/libdev.a%s

The "%s" makes the compiler driver to expand the argument to an absolute path provided the file can be found in multilib / startfile search paths and can be accessed.

This works as expected except in the case when the expanded path contains spaces. The expanded path could escaped by an avr-specific spec function, however one level of escaping is not enough as lib_spec and its expansion is (re)used several times and passed around, e.g. by passthrough mechanisms of LTO compilations. Escaping escaped sequences is not possible because the escape character will become a part of the path name then.

To make a long story short:

The current location for libdev.a is likely to cause problems when avr-gcc 5.0 hits user land, in particular windows where spaces in path names are not uncommon.

Consequently, a new device library naming convention is needed. The simpliest solution would be to rename the device lib to "libatmega8.a" and place it in its multilib directory, i.e. what

$ avr-gcc -print-multi-directory -mmcu=atmega8

will print ("avr4" in that case). With that naming convention lib_spec could be written as

*lib:
        -lc -latmega8

which works as expected.

Advantage of multilib directory is that it works exactly the same way if we should ever have more than one multilib per device, e.g. if we raise any ordinary option to a multilib option in the future.


Johann






reply via email to

[Prev in Thread] Current Thread [Next in Thread]