- Status Closed
- Percent Complete
- Task Type Bugs
- Category Operating System/Drivers
- Assigned To No-one
- Operating System All players
- Severity Low
- Priority Very Low
- Reported Version
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#7183 - ARM-GCC 4.11 compiler error in thread.c
I use ARM-GCC 4.1.1 from http://www.gnuarm.org/.
By the way, it generates slightly smaller code.
It only have problem with start_thread declaration. To fix this error we have to remove static declaration of this function.
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
What problem does gcc 4.1.1 have with declaring start_thread as static? Do you know if this is a deliberate change in behaviour by gcc or a bug?
Error message is:
/cygdrive/c/rockbox/build-device/librockbox.a(thread.o): In function `create_thread':
thread.c:(.text+0x95c): undefined reference to `start_thread'
I guess this may be caused by call from inline assembler in function 'load_context'?
static inline void load_context(const void* addr)
{
}
Probably discards the "unreferenced" (by C code) static function as an "optimization" then tries to link it. Sounds buggy to me and obviously doesn't trip up arm-elf-gcc 4.0.3. :
Not sure if it is a bug; similar things can be seen in other places with newer versions of GCC. A better fix would be to add "attribute 1)" to start_thread. (While at it, one could also add "attribute 2)" to stuff that shouldn't be inlined.)
Here is patch with attribute 1).