diff --git a/emulators/virtualbox-ose/Makefile b/emulators/virtualbox-ose/Makefile --- a/emulators/virtualbox-ose/Makefile +++ b/emulators/virtualbox-ose/Makefile @@ -217,17 +217,30 @@ .endif .if ${CHOSEN_COMPILER_TYPE} == clang -# llvm10 in FreeBSD before r364284 miscompiles virtualbox 6.1 causing errors. -# force llvm11 from ports +# 1) llvm10 in FreeBSD before r364284 miscompiles virtualbox 6.1 causing errors. +# 2) llvm15 in FreeBSD miscompiles virtualbox 6.1 causing errors: PR#270189. +# Force llvm from ports. .if ${OPSYS} == FreeBSD && \ - (${OSVERSION} < 1203502 || ${OSVERSION} >= 1300000 && ${OSVERSION} < 1300109) + (${OSVERSION} < 1203502 || ${OSVERSION} >= 1300000 && ${OSVERSION} < 1300109 || \ + ${OSVERSION} >= 1302505 && ${OSVERSION} < 1400000 || ${OSVERSION} >= 1400079) +# USES must be before .include , but CHOSEN_COMPILER_TYPE must be after. +# This is a workaround with possibility to define different llvm via VBOX_LLVM_VER in make.conf. +#USES+= llvm:min=11,max=14 +#CC= clang${LLVM_VERSION} +#CXX= clang++${LLVM_VERSION} BUILD_DEPENDS+= clang${VBOX_LLVM_VER}:devel/llvm${VBOX_LLVM_VER} CC= clang${VBOX_LLVM_VER} CXX= clang++${VBOX_LLVM_VER} -VBOX_LLVM_VER?= 11 +.if ${LLVM_DEFAULT} < 11 || ${LLVM_DEFAULT} > 14 +VBOX_LLVM_VER?= 14 +.else +VBOX_LLVM_VER?= ${LLVM_DEFAULT} +.endif .endif PATCH_DEPENDS+= ${LOCALBASE}/share/kBuild/tools/GXX3.kmk:devel/kBuild EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src-VBox-Devices-PC-ipxe-Makefile.kmk +EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src_VBox_Devices_PC_ipxe_src_core_settings.c +EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src_VBox_Devices_PC_ipxe_src_net_tcp_httpcore.c .endif .if ${PYTHON_MAJOR_VER} >= 3 diff --git a/emulators/virtualbox-ose/files/extrapatch-src_VBox_Devices_PC_ipxe_src_core_settings.c b/emulators/virtualbox-ose/files/extrapatch-src_VBox_Devices_PC_ipxe_src_core_settings.c new file mode 100644 --- /dev/null +++ b/emulators/virtualbox-ose/files/extrapatch-src_VBox_Devices_PC_ipxe_src_core_settings.c @@ -0,0 +1,11 @@ +--- src/VBox/Devices/PC/ipxe/src/core/settings.c.orig ++++ src/VBox/Devices/PC/ipxe/src/core/settings.c +@@ -286,7 +286,7 @@ + const char *name ) { + struct { + struct autovivified_settings autovivified; +- char name[ strlen ( name ) + 1 /* NUL */ ]; ++ char name[ 32 ]; + } *new_child; + struct settings *settings; + diff --git a/emulators/virtualbox-ose/files/extrapatch-src_VBox_Devices_PC_ipxe_src_net_tcp_httpcore.c b/emulators/virtualbox-ose/files/extrapatch-src_VBox_Devices_PC_ipxe_src_net_tcp_httpcore.c new file mode 100644 --- /dev/null +++ b/emulators/virtualbox-ose/files/extrapatch-src_VBox_Devices_PC_ipxe_src_net_tcp_httpcore.c @@ -0,0 +1,15 @@ +--- src/VBox/Devices/PC/ipxe/src/net/tcp/httpcore.c.orig ++++ src/VBox/Devices/PC/ipxe/src/net/tcp/httpcore.c +@@ -646,9 +646,9 @@ + int request_len = unparse_uri ( NULL, 0, http->uri, + URI_PATH_BIT | URI_QUERY_BIT ); + struct { +- uint8_t user_pw[ user_pw_len + 1 /* NUL */ ]; +- char user_pw_base64[ user_pw_base64_len + 1 /* NUL */ ]; +- char request[ request_len + 1 /* NUL */ ]; ++ uint8_t user_pw[ 32 ]; ++ char user_pw_base64[ 64 ]; ++ char request[ 1024 ]; + char range[48]; /* Enough for two 64-bit integers in decimal */ + } *dynamic; + int partial;