[php-src] Issue #7914: Building litespeed sapi on riscv64 fails

From: Date: Sat, 08 Jan 2022 19:10:17 +0000
Subject: [php-src] Issue #7914: Building litespeed sapi on riscv64 fails
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238886@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/7914 Comment Author: nmeum > Debug shows that it caused by usage __sync_lock_test_and_set_1 > with constant According to the [GCC documentation](https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html), the problem likely is that some architecture only support __sync_lock_test_and_set_1 with reduced functionality, meaning: > […] the only valid value to store is the immediate constant 1. The **exact value actually > stored in *ptr is implementation defined**. The RISC-V architecture seems to be one of these architectures. For this reason, my understanding is that portable could should not use __sync_lock_test_and_set_1 with a store value other than the constant 1 (in general using a different value seems to rely on implementation defined behavior). Unfortunately, the lsapilib.c file does presently use __sync_lock_test_and_set_1 with other store values in several places: https://github.com/php/php-src/blob/7d5a9dd05da714917535571539487720280de839/sapi/litespeed/lsapilib.c#L445-L446 https://github.com/php/php-src/blob/7d5a9dd05da714917535571539487720280de839/sapi/litespeed/lsapilib.c#L1589-L1591 https://github.com/php/php-src/blob/7d5a9dd05da714917535571539487720280de839/sapi/litespeed/lsapilib.c#L3318-L3319 Since there is no builtin supporting this on the RISC-V architecture, this causes the linking error mentioned in the original post when PHP is compiled with --enable-litespeed. The three code parts linked above correspond to the three “undefined symbol“ linking errors.

« previous php.bugs (#238886) next »