[vbox-dev] Virtualbox build failure with gcc 5-20150205 [partial PATCH included]

Frank Mehnert frank.mehnert at oracle.com
Mon Feb 23 09:51:06 GMT 2015


Hi Gianfranco,

On Saturday 14 February 2015 18:25:35 Gianfranco Costamagna wrote:
> I'm sending you a patch to make virtualbox "build" against gcc-5
> (upcoming release, not yet stable.)
> 
> As usual my work has to be considered MIT licensed.

actually I had the same idea yesterday evening to use the gcc-5 snapshot
packages which were recently added to Debian/Experimental to compile the
VBox code and later I saw your mail :-)

> I'm not quite confortable with the patch, but I'm happy to share it with you
> (I don't attach a file because as said I'm not quite confortable)
> 
> 
> 1) usual configure changes (don't know the gcc upper bound)

We will do this change later. Right now gcc 5 is not stable and we
don't want to encourage people to use gcc 5 to compile VBox to not
get false reports.

> 2) three changes because gcc doesn't exactly know how to handle parenthesis
> (not gcc-5 specific, I guess it is spotted because of some "Wparenthesis"
> build flag that gcc-5 defaults to true)
> 
> --- a/src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp
> +++ b/src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp
> @@ -77,7 +77,7 @@ static DECLCALLBACK(int)
> rtAsn1BitStringEncodeCompare(const void *pvBuf, size_t {
> RTASN1BITSTRINGWRITERCTX *pCtx = (RTASN1BITSTRINGWRITERCTX *)pvUser;
> AssertReturn(cbToWrite <= pCtx->cbBuf - pCtx->offBuf, VERR_BUFFER_OVERFLOW);
> -    if (!memcmp(&pCtx->pbBuf[pCtx->offBuf], pvBuf, cbToWrite) != 0) +   
> if (!memcmp(&pCtx->pbBuf[pCtx->offBuf], pvBuf, cbToWrite))
> return VERR_NOT_EQUAL;
> pCtx->offBuf += (uint32_t)cbToWrite;
> return VINF_SUCCESS;
> 
> 
> --- a/src/VBox/Runtime/common/asn1/asn1-ut-octetstring.cpp
> +++ b/src/VBox/Runtime/common/asn1/asn1-ut-octetstring.cpp
> @@ -77,7 +77,7 @@ static DECLCALLBACK(int)
> rtAsn1OctetStringEncodeCompare(const void *pvBuf, size_ {
> RTASN1OCTETSTRINGWRITERCTX *pCtx = (RTASN1OCTETSTRINGWRITERCTX *)pvUser;
> AssertReturn(cbToWrite <= pCtx->cbBuf - pCtx->offBuf, VERR_BUFFER_OVERFLOW);
> -    if (!memcmp(&pCtx->pbBuf[pCtx->offBuf], pvBuf, cbToWrite) != 0) +   
> if (!memcmp(&pCtx->pbBuf[pCtx->offBuf], pvBuf, cbToWrite))
> return VERR_NOT_EQUAL;
> pCtx->offBuf += (uint32_t)cbToWrite;
> return VINF_SUCCESS;

Both your fixes are correct and were committed to the repository. Most
likely this code is not used anyway.

> --- a/src/VBox/Runtime/common/zip/tarvfs.cpp
> +++ b/src/VBox/Runtime/common/zip/tarvfs.cpp
> @@ -366,7 +366,7 @@ static int rtZipTarHdrValidate(PCRTZIPTARHDR pTar,
> PRTZIPTARTYPE penmType) {
> case RTZIPTARTYPE_POSIX:
> if (   !RT_C_IS_ALNUM(pTar->Common.typeflag)
> -                && !pTar->Common.typeflag == '\0')
> +                && pTar->Common.typeflag != '\0') (maybe we can even remove
> the !='\0) return VERR_TAR_UNKNOWN_TYPE_FLAG;
> break;

Correct, committed.

> 3) a build failure that goes away without the "-O" flag, but needs to be
> fixed :) (I do not have time/knowledge/resources to properly fix this)
> 
> [...]
> /virtualbox-4.3.22-dfsg/src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/uni
> x/xptcinvoke_x86_64_linux.cpp:211:1: error: unable to find a register to
> spill }
> ^
> [...]

That one will be more complicated and so far it looks to me like a regression
in gcc.

> 4) there are two "while (iPage-- > 0)" loops

We fixed this properly.

There are a few more problems lurking in the code. A few will be fixed soon.
As I said, we will keep an eye on gcc-5-related problems but fixing them is
currently not top-priority.

Thank you,

Frank
-- 
Dr.-Ing. Frank Mehnert | Software Development Director, VirtualBox
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | 71384 Weinstadt, Germany

Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603
Geschäftsführer: Jürgen Kunz

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher




More information about the vbox-dev mailing list