From: Ed Maste Date: Fri, 11 Feb 2022 15:25:46 +0000 (+0000) Subject: liblzma: Use non-executable stack on FreeBSD as on Linux X-Git-Tag: v5.3.3alpha~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=865e0a3689a25a7ee8eecae1a34c1775e3aa676e;p=thirdparty%2Fxz.git liblzma: Use non-executable stack on FreeBSD as on Linux --- diff --git a/src/liblzma/check/crc32_x86.S b/src/liblzma/check/crc32_x86.S index 7814beca..4f395df8 100644 --- a/src/liblzma/check/crc32_x86.S +++ b/src/liblzma/check/crc32_x86.S @@ -305,9 +305,9 @@ LZMA_CRC32: /* * This is needed to support non-executable stack. It's ugly to - * use __linux__ here, but I don't know a way to detect when + * use __FreeBSD__ and __linux__ here, but I don't know a way to detect when * we are using GNU assembler. */ -#if defined(__ELF__) && defined(__linux__) +#if defined(__ELF__) && (defined(__FreeBSD__) || defined(__linux__)) .section .note.GNU-stack,"",@progbits #endif diff --git a/src/liblzma/check/crc64_x86.S b/src/liblzma/check/crc64_x86.S index 7ee08f64..9aecf586 100644 --- a/src/liblzma/check/crc64_x86.S +++ b/src/liblzma/check/crc64_x86.S @@ -288,9 +288,9 @@ LZMA_CRC64: /* * This is needed to support non-executable stack. It's ugly to - * use __linux__ here, but I don't know a way to detect when + * use __FreeBSD__ and __linux__ here, but I don't know a way to detect when * we are using GNU assembler. */ -#if defined(__ELF__) && defined(__linux__) +#if defined(__ELF__) && (defined(__FreeBSD__) || defined(__linux__)) .section .note.GNU-stack,"",@progbits #endif