Menu

#22 Fix MSVC breakage due to GNU align extensions in setjmp

Unstable_(example)
closed
None
5
2015-09-23
2015-09-17
Pete Batard
No

Now that I have updated to latest, I also found that MSVC compilation is broken due to the use of the GNU specific 'attribute((aligned(x)))' in the newly introduced setjmp files.

This patch addresses this by defining an ALIGN() macro prior to including the architecture specific content.
I also made sure JMPBUF_ALIGN was defined from all archs, in case this ever needs to be used.

There might also be a better way to do this than to define a macro before an include, such as the one mentioned at the end of http://stackoverflow.com/q/7895869, where we could define the arch specific structs under a different name, as unaligned, and then redefine the struct as aligned in efisetjmp.h.

NB: I'm also a bit surprised to see that IA64 aligns to 128 bits (0x10) instead of 64 (8) in efisetjmp_arch.h, but I don't know enough about this arch to know if that's really incorrect.

1 Attachments

Discussion

  • Nigel Croxon

    Nigel Croxon - 2015-09-23

    commit 9ce3546d057283f4ce259e257f0f491973492e95
    Author: Nigel Croxon nigel.croxon@hpe.com
    Date: Wed Sep 23 10:03:31 2015 -0400

    From: Pete Batard <pete@akeo.ie>
    Subject: [PATCH] Fix MSVC breakage due to GNU align extensions in setjmp
    
    
    * __attribute__((__aligned__(x))), which is used in setjmp, is GNU only => use a macro instead
    
    Signed-off-by: Pete Batard <pete@akeo.ie>
    Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
    
     
  • Nigel Croxon

    Nigel Croxon - 2015-09-23
    • status: open --> closed
    • assigned_to: Nigel Croxon
     

Log in to post a comment.

MongoDB Logo MongoDB