Raymond Toy pushed to branch issue-122-dynamically-allocate-altstack at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/lisp/interrupt.c
    ... ... @@ -406,7 +406,7 @@ interrupt_maybe_gc(HANDLER_ARGS)
    406 406
     \****************************************************************/
    
    407 407
     
    
    408 408
     #if defined(__linux__)
    
    409
    -char* altstack;
    
    409
    +char* altstack = NULL;
    
    410 410
     #else
    
    411 411
     char altstack[SIGNAL_STACK_SIZE];
    
    412 412
     #endif
    
    ... ... @@ -436,7 +436,14 @@ interrupt_install_low_level_handler(int signal, void handler(HANDLER_ARGS))
    436 436
     	sigstack.ss_sp = (void *) SIGNAL_STACK_START;
    
    437 437
     #else
    
    438 438
     #if defined(__linux__)
    
    439
    -        altstack = malloc(SIGSTKSZ);
    
    439
    +        /*
    
    440
    +         * For gcc 11.2 (clang 13.0), we need to allocate altstack
    
    441
    +         * dynamically.  Do this here, but only if we haven't already
    
    442
    +         * allocated space.
    
    443
    +         */
    
    444
    +        if (altstack == NULL) {
    
    445
    +            altstack = malloc(SIGSTKSZ);
    
    446
    +        }
    
    440 447
     #endif
    
    441 448
     	sigstack.ss_sp = (void *) altstack;
    
    442 449
     #endif