Ticket #498: parrot-linux-aligncheck-fix.diff

File parrot-linux-aligncheck-fix.diff, 0.9 KB (added by ccollins, 6 years ago)

alignment check fixup patch for linux

  • config/auto/alignptrs/test_c.in

    diff -ruN parrot-1.0.0/config/auto/alignptrs/test_c.in parrot-1.0.0.XF/config/auto/alignptrs/test_c.in
    old new  
    1414void bletch(int s) { exit(1); } 
    1515#endif 
    1616 
     17#ifdef __linux 
     18#include <sys/prctl.h> 
     19#endif /* __linux */ 
     20 
    1721int 
    1822main(int argc, char **argv) 
    1923{ 
     
    3438    signal(SIGBUS, bletch); 
    3539#endif 
    3640 
     41#if defined(PR_SET_UNALIGN) && defined(PR_UNALIGN_SIGBUS) 
     42    prctl(PR_SET_UNALIGN, PR_UNALIGN_SIGBUS, 0, 0, 0); 
     43#endif 
     44 
    3745    for (i = 0; i < 32; i ++) space[i] = 0; 
    3846 
    3947    for (c = argv[1]; *c; c++) align = align * 10 + ((int)*c - '0'); 
    4048 
    41 #if defined(__alpha) 
     49#if defined(__alpha) && !defined(PR_SET_UNALIGN) 
    4250    if (align < 8) { 
    4351        printf("Soft failure hack for systems that simulate unaligned access\n"); 
    4452        return 1;