From feaa690dc6673073039e81c9e5d43d2a65224cfa Mon Sep 17 00:00:00 2001 From: Huang Zhichao Date: Wed, 11 Mar 2026 15:49:21 +0800 Subject: [PATCH] FreeBSD libc: prevent ssp headers from being included before FreeBSD 15 --- lib/libc/include/generic-freebsd/ssp/poll.h | 6 ++++++ lib/libc/include/generic-freebsd/ssp/random.h | 6 ++++++ lib/libc/include/generic-freebsd/ssp/signal.h | 6 ++++++ lib/libc/include/generic-freebsd/ssp/socket.h | 6 ++++++ lib/libc/include/generic-freebsd/ssp/ssp.h | 6 ++++++ lib/libc/include/generic-freebsd/ssp/stdio.h | 6 ++++++ lib/libc/include/generic-freebsd/ssp/stdlib.h | 6 ++++++ lib/libc/include/generic-freebsd/ssp/string.h | 6 ++++++ lib/libc/include/generic-freebsd/ssp/strings.h | 6 ++++++ lib/libc/include/generic-freebsd/ssp/uio.h | 6 ++++++ lib/libc/include/generic-freebsd/ssp/unistd.h | 6 ++++++ lib/libc/include/generic-freebsd/ssp/wchar.h | 6 ++++++ 12 files changed, 72 insertions(+) diff --git a/lib/libc/include/generic-freebsd/ssp/poll.h b/lib/libc/include/generic-freebsd/ssp/poll.h index 6db5bcd102a3494632589c45ad4ae66bc5bf539b..3f311ef7dcd20be78d26ab4f502618f479a95498 100644 --- a/lib/libc/include/generic-freebsd/ssp/poll.h +++ b/lib/libc/include/generic-freebsd/ssp/poll.h @@ -24,6 +24,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +// zig patch: ssp/poll.h header was added in FreeBSD 15 +#if __FreeBSD_version < 1500500 + #error "ssp/poll.h did not exist before FreeBSD 15" +#endif /* error for FreeBSD before 15 */ + #ifndef _SSP_POLL_H_ #define _SSP_POLL_H_ diff --git a/lib/libc/include/generic-freebsd/ssp/random.h b/lib/libc/include/generic-freebsd/ssp/random.h index 83d1b33f1dd73f21e596f91ae991887af21b39e9..12bfbb469a52f03c842f7e3ed0811dd0bea8bbda 100644 --- a/lib/libc/include/generic-freebsd/ssp/random.h +++ b/lib/libc/include/generic-freebsd/ssp/random.h @@ -24,6 +24,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +// zig patch: ssp/random.h header was added in FreeBSD 15 +#if __FreeBSD_version < 1500500 + #error "ssp/random.h did not exist before FreeBSD 15" +#endif /* error for FreeBSD before 15 */ + #ifndef _SSP_RANDOM_H_ #define _SSP_RANDOM_H_ diff --git a/lib/libc/include/generic-freebsd/ssp/signal.h b/lib/libc/include/generic-freebsd/ssp/signal.h index f37940750e054588b16bb89e42c7745c754b54cf..6d9ab6bad624aff4efc164be91dabab14dadd20f 100644 --- a/lib/libc/include/generic-freebsd/ssp/signal.h +++ b/lib/libc/include/generic-freebsd/ssp/signal.h @@ -24,6 +24,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +// zig patch: ssp/signal.h header was added in FreeBSD 15 +#if __FreeBSD_version < 1500500 + #error "ssp/signal.h did not exist before FreeBSD 15" +#endif /* error for FreeBSD before 15 */ + #ifndef _SSP_SIGNAL_H_ #define _SSP_SIGNAL_H_ diff --git a/lib/libc/include/generic-freebsd/ssp/socket.h b/lib/libc/include/generic-freebsd/ssp/socket.h index e8abe21e769cfc4d691ef0fae30268f43c26f80f..ef03f36a27e59df4e2e806b1230d348c0d943888 100644 --- a/lib/libc/include/generic-freebsd/ssp/socket.h +++ b/lib/libc/include/generic-freebsd/ssp/socket.h @@ -24,6 +24,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +// zig patch: ssp/socket.h header was added in FreeBSD 15 +#if __FreeBSD_version < 1500500 + #error "ssp/socket.h did not exist before FreeBSD 15" +#endif /* error for FreeBSD before 15 */ + #ifndef _SSP_SOCKET_H_ #define _SSP_SOCKET_H_ diff --git a/lib/libc/include/generic-freebsd/ssp/ssp.h b/lib/libc/include/generic-freebsd/ssp/ssp.h index 9dce2d40139300c854796e00a1e04c870af9503f..d467f32ec91d19a4d956e5e9b0890792e089a8c9 100644 --- a/lib/libc/include/generic-freebsd/ssp/ssp.h +++ b/lib/libc/include/generic-freebsd/ssp/ssp.h @@ -31,6 +31,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +// zig patch: ssp/ssp.h header was added in FreeBSD 15 +#if __FreeBSD_version < 1500500 + #error "ssp/ssp.h did not exist before FreeBSD 15" +#endif /* error for FreeBSD before 15 */ + #ifndef _SSP_SSP_H_ #define _SSP_SSP_H_ diff --git a/lib/libc/include/generic-freebsd/ssp/stdio.h b/lib/libc/include/generic-freebsd/ssp/stdio.h index 76bc897573a124069a77100f1b84229f842aa742..20c098c2a6f8672b0993743f1bc0359203cfb218 100644 --- a/lib/libc/include/generic-freebsd/ssp/stdio.h +++ b/lib/libc/include/generic-freebsd/ssp/stdio.h @@ -31,6 +31,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +// zig patch: ssp/stdio.h header was added in FreeBSD 15 +#if __FreeBSD_version < 1500500 + #error "ssp/stdio.h did not exist before FreeBSD 15" +#endif /* error for FreeBSD before 15 */ + #ifndef _SSP_STDIO_H_ #define _SSP_STDIO_H_ diff --git a/lib/libc/include/generic-freebsd/ssp/stdlib.h b/lib/libc/include/generic-freebsd/ssp/stdlib.h index c41fd7c2029fea94722833b413ab8f3b36837f74..331601b2abc120337f83ef83eaf5e9aad51f5ca9 100644 --- a/lib/libc/include/generic-freebsd/ssp/stdlib.h +++ b/lib/libc/include/generic-freebsd/ssp/stdlib.h @@ -24,6 +24,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +// zig patch: ssp/stdlib.h header was added in FreeBSD 15 +#if __FreeBSD_version < 1500500 + #error "ssp/stdlib.h did not exist before FreeBSD 15" +#endif /* error for FreeBSD before 15 */ + #ifndef _SSP_STDLIB_H_ #define _SSP_STDLIB_H_ diff --git a/lib/libc/include/generic-freebsd/ssp/string.h b/lib/libc/include/generic-freebsd/ssp/string.h index 8e50a74174c0cc551ee373d8231c442326aad7b2..e1d18294a352d7f3a573d6694d6ee534a1ba7c68 100644 --- a/lib/libc/include/generic-freebsd/ssp/string.h +++ b/lib/libc/include/generic-freebsd/ssp/string.h @@ -31,6 +31,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +// zig patch: ssp/string.h header was added in FreeBSD 15 +#if __FreeBSD_version < 1500500 + #error "ssp/string.h did not exist before FreeBSD 15" +#endif /* error for FreeBSD before 15 */ + #ifndef _SSP_STRING_H_ #define _SSP_STRING_H_ diff --git a/lib/libc/include/generic-freebsd/ssp/strings.h b/lib/libc/include/generic-freebsd/ssp/strings.h index fc3b14062efcf7fbfbad4e13d94d65485c19ba09..154d39f6dcfc7e015da95be575e367f8b56a9699 100644 --- a/lib/libc/include/generic-freebsd/ssp/strings.h +++ b/lib/libc/include/generic-freebsd/ssp/strings.h @@ -31,6 +31,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +// zig patch: ssp/strings.h header was added in FreeBSD 15 +#if __FreeBSD_version < 1500500 + #error "ssp/strings.h did not exist before FreeBSD 15" +#endif /* error for FreeBSD before 15 */ + #ifndef _SSP_STRINGS_H_ #define _SSP_STRINGS_H_ diff --git a/lib/libc/include/generic-freebsd/ssp/uio.h b/lib/libc/include/generic-freebsd/ssp/uio.h index cd513db6aac96a2c1a22a83ebbbe1d1e0a795922..651a5260e8f6de2a949dd8d3e37ad2c6e9fb86a8 100644 --- a/lib/libc/include/generic-freebsd/ssp/uio.h +++ b/lib/libc/include/generic-freebsd/ssp/uio.h @@ -24,6 +24,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +// zig patch: ssp/uio.h header was added in FreeBSD 15 +#if __FreeBSD_version < 1500500 + #error "ssp/uio.h did not exist before FreeBSD 15" +#endif /* error for FreeBSD before 15 */ + #ifndef _SSP_UIO_H_ #define _SSP_UIO_H_ diff --git a/lib/libc/include/generic-freebsd/ssp/unistd.h b/lib/libc/include/generic-freebsd/ssp/unistd.h index fc7a17da37034fd88ef062aa016f2513a5bda488..70ad055dcd6e2917623d0bc934cb8fd21dc63528 100644 --- a/lib/libc/include/generic-freebsd/ssp/unistd.h +++ b/lib/libc/include/generic-freebsd/ssp/unistd.h @@ -31,6 +31,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +// zig patch: ssp/unistd.h header was added in FreeBSD 15 +#if __FreeBSD_version < 1500500 + #error "ssp/unistd.h did not exist before FreeBSD 15" +#endif /* error for FreeBSD before 15 */ + #ifndef _SSP_UNISTD_H_ #define _SSP_UNISTD_H_ diff --git a/lib/libc/include/generic-freebsd/ssp/wchar.h b/lib/libc/include/generic-freebsd/ssp/wchar.h index 4b22b755b1629e00eae7495ff464cd98f8115390..45eb29829b5b5342ac09c4207671ea596e6eeb47 100644 --- a/lib/libc/include/generic-freebsd/ssp/wchar.h +++ b/lib/libc/include/generic-freebsd/ssp/wchar.h @@ -24,6 +24,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +// zig patch: ssp/wchar.h header was added in FreeBSD 15 +#if __FreeBSD_version < 1500500 + #error "ssp/wchar.h did not exist before FreeBSD 15" +#endif /* error for FreeBSD before 15 */ + #ifndef _SSP_WCHAR_H_ #define _SSP_WCHAR_H_ -- 2.54.0