Bug 22295 - Не правильный путь хидерных файлов
Summary: Не правильный путь хидерных файлов
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: avr-gcc (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Grigory Milev
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-15 23:29 MSK by Dmitry A. Kharitonov
Modified: 2011-01-18 16:44 MSK (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry A. Kharitonov 2009-11-15 23:29:18 MSK
Правильный путь такой:
/usr/include/avr
Comment 1 Michael Shigorin 2009-11-16 00:54:17 MSK
Остаётся Вам и поправить.
Comment 2 Dmitry A. Kharitonov 2009-11-16 12:23:33 MSK
(В ответ на комментарий №1)
> Остаётся Вам и поправить.
Руки дойдут -- займусь
Comment 3 Grigory Milev 2009-12-19 01:13:23 MSK
А где он не правильный то?
Можно подетальнее?
Comment 4 Dmitry A. Kharitonov 2009-12-19 14:27:21 MSK
Я считаю, что программы должны компилироваться без дополнительного указания путей.

[user@localhost CTRL6437]$ cat test.cpp
#include <avr/io.h>

int main() {
    uint8_t k=0,t=5;
    k=k+t;
}
[user@localhost CTRL6437]$ avr-gcc -Wall -Werror -g -Os -S -mint8 -mmcu=atmega8535 test.cpp
test.cpp:1:20: error: avr/io.h: No such file or directory
test.cpp: In function 'int main()':
test.cpp:4: error: 'uint8_t' was not declared in this scope
test.cpp:4: error: expected `;' before 'k'
test.cpp:5: error: 'k' was not declared in this scope
test.cpp:5: error: 't' was not declared in this scope
[user@localhost CTRL6437]$ avr-gcc -Wall -Werror -g -Os -S -mint8 -I/usr/include/avr -mmcu=atmega8535 test.cpp

А что? появился ответственный за пакет? я тогда ещё парочку багов повешу, намного серьёзней.
Comment 5 Dmitry A. Kharitonov 2009-12-19 14:32:16 MSK
[user@localhost CTRL6437]$ avr-gcc -v -Wall -Werror -g -Os -S -mint8 -mmcu=atmega8535 test.cpp
Reading specs from /usr/lib/avr/lib/gcc/avr/4.2.2/specs
Target: avr
Configured with: ../configure --target=avr --host=i586-alt-linux --enable-languages=c,c++ --disable-nls --disable-libssp --enable-target-optspace --includedir=/usr/include/avr --prefix=/usr --exec-prefix=/usr/lib/avr --mandir=/usr/share/man --infodir=/usr/share/info --libexecdir=/usr/lib
Thread model: single
gcc version 4.2.2
 /usr/lib/avr/lib/gcc/avr/4.2.2/cc1plus -quiet -v -imultilib avr4 -iprefix /usr/bin/../lib/gcc/avr/4.2.2/ test.cpp -quiet -dumpbase test.cpp -mint8 -mmcu=atmega8535 -auxbase test -g -Os -Wall -Werror -version -o test.s -fno-rtti -fno-enforce-eh-specs -fno-exceptions
ignoring nonexistent directory "/usr/bin/../lib/gcc/avr/4.2.2/../../../../../../avr/include/c++/4.2.2"
ignoring nonexistent directory "/usr/bin/../lib/gcc/avr/4.2.2/../../../../../../avr/include/c++/4.2.2/avr/avr4"
ignoring nonexistent directory "/usr/bin/../lib/gcc/avr/4.2.2/../../../../../../avr/include/c++/4.2.2/backward"
ignoring nonexistent directory "/usr/bin/../lib/gcc/avr/4.2.2/include"
ignoring nonexistent directory "/usr/bin/../lib/gcc/avr/4.2.2/../../../../../avr/sys-include"
ignoring nonexistent directory "/usr/bin/../lib/gcc/avr/4.2.2/../../../../../avr/include"
ignoring nonexistent directory "/usr/lib/avr/lib/gcc/avr/4.2.2/../../../../../../avr/include/c++/4.2.2"
ignoring nonexistent directory "/usr/lib/avr/lib/gcc/avr/4.2.2/../../../../../../avr/include/c++/4.2.2/avr/avr4"
ignoring nonexistent directory "/usr/lib/avr/lib/gcc/avr/4.2.2/../../../../../../avr/include/c++/4.2.2/backward"
ignoring nonexistent directory "/usr/lib/avr/lib/gcc/avr/4.2.2/../../../../../avr/sys-include"
ignoring nonexistent directory "/usr/lib/avr/lib/gcc/avr/4.2.2/../../../../../avr/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/avr/lib/gcc/avr/4.2.2/include
End of search list.
GNU C++ version 4.2.2 (avr)
        compiled by GNU C version 4.1.1 20070105 (ALT Linux, build 4.1.1-alt12).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c5330874b383ef69ee2b5cc70c04cc58
test.cpp:1:20: error: avr/io.h: No such file or directory
test.cpp: In function 'int main()':
test.cpp:4: error: 'uint8_t' was not declared in this scope
test.cpp:4: error: expected `;' before 'k'
test.cpp:5: error: 'k' was not declared in this scope
test.cpp:5: error: 't' was not declared in this scope
Comment 6 Grigory Milev 2009-12-19 17:26:19 MSK
Так никуда я и не пропадал ;)
Comment 7 Grigory Milev 2011-01-18 11:46:41 MSK
Добавлять хидеры AVR в системные пути - не разумно (будут сплошные пересечения), именно по этой причине они и лежат в /usr/include/avr. Не вижу проблемы указывать <avr/zzz> или добавлять опци. компилятору.
Comment 8 Dmitry A. Kharitonov 2011-01-18 15:42:10 MSK
А в avr-* добавить некуда? Несовместимость с winavr получается. Это не удобно.
Comment 9 Grigory Milev 2011-01-18 15:55:33 MSK
Так и что я туда могу добавить то? Они пересекаются с системными и по названию, и по содержимому. Если сделать их просто доступными по штатным путям, то прийдется вагон остального линукс софта отучать брать avr хидеры, кому это надо? А совместимость с winavr делается легко на уровне Makefile.

Если у Вас есть другие правильные решения, продемонстрируйте пожалуйста.
Comment 10 Dmitry A. Kharitonov 2011-01-18 16:14:34 MSK
У avr линковщик свой. Вот в него и нужно прописать этот путь.
Comment 11 Dmitry A. Kharitonov 2011-01-18 16:30:36 MSK
(В ответ на комментарий №10)
> У avr линковщик свой. Вот в него и нужно прописать этот путь.
вернее сказать компилятор свой avr-gcc вот в него и нужно прописать.
а как это может повлиять на gcc?
Comment 12 Grigory Milev 2011-01-18 16:36:09 MSK
Так линковщик хидеры не разгребает, этим препроцессор занимается. При сборке avr-gcc пути с инклюдами указываются именно туда, где они сейчас и лежат. Каким образом его обучить сразу знать данные места? Если имеете готовое решение/patch, с радостью добавлю к нашей сборке.
Comment 13 Dmitry A. Kharitonov 2011-01-18 16:44:24 MSK
Хорошо. Я по-думаю над этим