components/gcc49/patches/006-omp.h.in.patch
changeset 6923 338aea22bf22
parent 6922 499ba999c1ee
child 6924 e8aaad6b5075
equal deleted inserted replaced
6922:499ba999c1ee 6923:338aea22bf22
     1 # Stefan Teleman <[email protected]>
       
     2 # Make sure we get the right alignment for these structs.
       
     3 # Internal patch. Submitted upstream. Status pending.
       
     4 --- libgomp/omp.h.in	2014-01-02 17:25:54.000000000 -0500
       
     5 +++ libgomp/omp.h.in	2014-11-19 08:31:53.354302270 -0500
       
     6 @@ -31,16 +31,24 @@
       
     7     reflect the shape of the two types.  Their internals are private
       
     8     to the library.  */
       
     9  
       
    10 +#if defined(__x86_64__) || defined(__amd64) || defined(__sparc)
       
    11 +#define OMP_LOCK_ALIGN 8
       
    12 +#define OMP_NEST_LOCK_ALIGN 8
       
    13 +#else
       
    14 +#define OMP_LOCK_ALIGN 4
       
    15 +#define OMP_NEST_LOCK_ALIGN 4
       
    16 +#endif
       
    17 +
       
    18  typedef struct
       
    19  {
       
    20    unsigned char _x[@OMP_LOCK_SIZE@] 
       
    21 -    __attribute__((__aligned__(@OMP_LOCK_ALIGN@)));
       
    22 +    __attribute__((__aligned__(OMP_LOCK_ALIGN)));
       
    23  } omp_lock_t;
       
    24  
       
    25  typedef struct
       
    26  {
       
    27    unsigned char _x[@OMP_NEST_LOCK_SIZE@] 
       
    28 -    __attribute__((__aligned__(@OMP_NEST_LOCK_ALIGN@)));
       
    29 +    __attribute__((__aligned__(OMP_NEST_LOCK_ALIGN)));
       
    30  } omp_nest_lock_t;
       
    31  #endif
       
    32