#3160 closed defect (fixed)

Trace linker score support is broken

Reported by: Chris Johns Owned by: Chris Johns
Priority: high Milestone: 5.1
Component: unspecified Version: 5
Severity: blocker Keywords:
Cc: Blocked By:
Blocking:

Description

The trace linker needs to be updated to build. I am not sure which bit is broken. Building the tools gives:

[ 7/15] Compiling build/arm-rtems4.12-beagleboneblack/hello/both_hello/test.c.2.o                                                                                                                                                                                                                                         
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:134:13: error: 'Thread_queue_Flush_callout' undeclared here (not in a function); did you mean 'Thread_queue_Flush_filter'?                                                                                                                       
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    { sizeof (Thread_queue_Flush_callout), "Thread_queue_Flush_callout" },                                                                                                                                                                                      
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:              ^~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                                        
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:              Thread_queue_Flush_filter                                                            
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:140:13: error: 'CORE_mutex_Status' undeclared here (not in a function); did you mean 'CORE_mutex_Control'?                                                                                                                                       
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    { sizeof (CORE_mutex_Status), "CORE_mutex_Status" },                                                                                                                                                                                                        
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:              ^~~~~~~~~~~~~~~~~                                                                                                                                                                                                                                 
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:              CORE_mutex_Control                                                                                                                                                                                                                                
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:143:19: error: unknown type name 'CORE_mutex_Attributes'                                                                                                                                                                                         
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    { sizeof (const CORE_mutex_Attributes*), "const CORE_mutex_Attributes*" },                                                                                                                                                                                  
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:                    ^~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                                       
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:160:13: error: 'CORE_mutex_API_mp_support_callout' undeclared here (not in a function)                                                                                                                                                           
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    { sizeof (CORE_mutex_API_mp_support_callout), "CORE_mutex_API_mp_support_callout" },                                                                                                                                                                        
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                                 
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:321:13: error: 'Objects_Locations' undeclared here (not in a function); did you mean 'Objects_Information'?                                                                                                                                      
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    { sizeof (Objects_Locations*), "Objects_Locations*" },                                         
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:              ^~~~~~~~~~~~~~~~~                                                                    
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:              Objects_Information                                                                                                                                                                                                                               
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:321:31: error: expected expression before ')' token                                                                                                                                                                                              
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    { sizeof (Objects_Locations*), "Objects_Locations*" },                                         
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:                                ^                                                                                                                                                                                                                               
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:342:31: error: expected expression before ')' token                                 
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    { sizeof (Objects_Locations*), "Objects_Locations*" },                                         
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:                                ^                                                                  
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:359:31: error: expected expression before ')' token                                 
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    { sizeof (Objects_Locations*), "Objects_Locations*" },                                         
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:                                ^                                                                  
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:368:31: error: expected expression before ')' token                                 
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    { sizeof (Objects_Locations*), "Objects_Locations*" },                                         
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:                                ^                                                                  
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:443:31: error: expected expression before ')' token                                 
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    { sizeof (Objects_Locations*), "Objects_Locations*" },                                         
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:                                ^                                                                  
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:548:13: error: 'Thread_Start_types' undeclared here (not in a function); did you mean '_Thread_Start'?                                                                                                                                           
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    { sizeof (Thread_Start_types), "Thread_Start_types" },                                         
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:              ^~~~~~~~~~~~~~~~~~                                                                   
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:              _Thread_Start                                                                        
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:570:13: error: 'Thread_blocking_operation_States' undeclared here (not in a function); did you mean 'Thread_queue_Operations'?                                                                                                                   
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    { sizeof (Thread_blocking_operation_States), "Thread_blocking_operation_States" },             
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                     
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:              Thread_queue_Operations                                                              
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c: In function 'rtld_pg_printk_entry':                                                
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:678:3: warning: implicit declaration of function 'printk'; did you mean 'printf'? [-Wimplicit-function-declaration]                                                                                                                              
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    printk (">>> %s (0x%08x)\n", func_name, func_addr);                                            
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    ^~~~~~          
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:    printf          
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c: At top level:                                                                      
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:742:48: error: expected declaration specifiers or '...' before 'Thread_queue_Flush_callout'                                                                                                                                                      
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  void _CORE_mutex_Flush(CORE_mutex_Control* a1, Thread_queue_Flush_callout a2, uint32_t a3);      
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~                        
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:743:55: error: expected declaration specifiers or '...' before 'Thread_queue_Flush_callout'                                                                                                                                                      
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  void __real__CORE_mutex_Flush(CORE_mutex_Control* a1, Thread_queue_Flush_callout a2, uint32_t a3);                                                                                                                                                            
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~                 
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:744:55: error: expected declaration specifiers or '...' before 'Thread_queue_Flush_callout'                                                                                                                                                      
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  void __wrap__CORE_mutex_Flush(CORE_mutex_Control* a1, Thread_queue_Flush_callout a2, uint32_t a3)
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~                 
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  hello-deep.c:757:1: error: unknown type name 'CORE_mutex_Status'; did you mean 'CORE_mutex_Control'?                                                                                                                                                          
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  CORE_mutex_Status _CORE_mutex_Initialize(CORE_mutex_Control* a1, Thread_Control* a2, const CORE_mutex_Attributes* a3, bool a4);                                                                                                                               
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  ^~~~~~~~~~~~~~~~~ 
/Users/chris/development/rtems/4.12/bin/arm-rtems4.12-gcc:  CORE_mutex_Control

This is a snip of the errors.

Change History (9)

comment:1 Changed on Oct 2, 2017 at 11:50:12 AM by Sebastian Huber

I removed these types some months ago. Are you on the right branch? How can I build this stuff?

comment:2 in reply to:  1 Changed on Oct 2, 2017 at 10:23:58 PM by Chris Johns

Replying to Sebastian Huber:

I removed these types some months ago. Are you on the right branch?

Yes. There are types in the trace definitions ...

https://git.rtems.org/rtems-tools/tree/linkers/rtems-score-coremutex.ini

These definitions are a quick and dirty hack I would prefer to avoid however the long term solution is getting function signatures and types from the DWARF data but that work is more than the time I have available. I need someone to support the effort.

How can I build this stuff?

Clone examples-v2 and then build using the ./waf I have just added to the repo. The examples uses rtems_waf so configured in a similar way to libbsd.

comment:3 Changed on Oct 6, 2017 at 7:34:14 AM by Sebastian Huber

The CORE mutex implementation changed considerably. Most of it moved to inline functions. I am not sure what you want to trace here?

comment:4 Changed on Oct 6, 2017 at 7:36:18 AM by Sebastian Huber

Maybe this should be replaced by the thread queue enqueue and extract functions.

comment:5 in reply to:  4 Changed on Oct 7, 2017 at 12:16:31 AM by Chris Johns

Replying to Sebastian Huber:

Maybe this should be replaced by the thread queue enqueue and extract functions.

I think anything that makes sense will do. It is more of an example of what we can trace and the fact you can trace into the kernel some distance.

comment:6 Changed on Oct 12, 2017 at 10:53:52 AM by Sebastian Huber <sebastian.huber@…>

In b76fa74/rtems-tools:

linkers: Update due to API changes

Update #3160.

comment:7 Changed on Oct 12, 2017 at 10:56:24 AM by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: assignedclosed

In 3742597/examples-v2:

Update due to trace linker changes

Close #3160.

comment:8 Changed on Oct 12, 2017 at 3:54:19 PM by Chris Johns

Thank you for fixing this for me.

comment:9 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.