bugThe libunwind project - Bugs: bug #48756, improvement: add prefix to target...

 
 

bug #48756: improvement: add prefix to target arch of preprocessor define

Submitted by:  None
Submitted on:  Thu 11 Aug 2016 01:39:13 AM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 11 Aug 2016 01:43:43 AM UTC, comment #1:

Submitted by furushchev

Yuki Furuta <furushchev>
Thu 11 Aug 2016 01:39:13 AM UTC, original submission:

In libunwind, function is independent on architecture by defining function as macro.

e.g. in x86_64 processor:
unw_getcontext
-> unw_tdep_getcontext
-> UNW_ARCH_OBJ(getcontext)
-> UNW_PASTE(UNW_PASTE(UNW_PASTE(U,UNW_TARGET),), getcontext)

And macro UNW_TARGET is architecture(x86_64), therefore:
-> _Ux86_64_getcontext

This technique works at the most of projects, but in some projects architecture is set directly to preprocessor as an argument "-Dx86_64".
Passing "-Dx86_64" to compiler is equivalent to:
#define x86_64 1
And this causes
#define UNW_TARGET x86_64
-> 1
So, in this case, unw_getcontext is expanded to _U1_getcontext.

I suggest that this project should has own prefix for target.
How about updating definition of preprocessor macro like:

#define UNW_TARGET _Ux86_64
#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_TARGET,_),fn)

This never occurs any conflicts, I think.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by furushchev (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.3