VirtualBox

Ticket #6715 (closed enhancement: fixed)

Opened 4 years ago

Last modified 3 years ago

3.2.0 fails to compile with gcc 4.5

Reported by: arklinux Owned by:
Priority: major Component: other
Version: VirtualBox 3.2.0 Keywords:
Cc: Guest type: other
Host type: Linux

Description

VirtualBox 3.2.0 fails to build with gcc 4.5 -- first, the configure check barfs because it isn't aware of gcc 4.5 existing.

After adapting it, the build fails because -Werror is used, and gcc 4.5 produces some new warnings:

cc1plus: warnings being treated as errors In file included from /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAl l/PGMAll.cpp:236:0: /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAll/PGMAllGst.h: In func tion âint pgmR3GstAMD64GetPage(VMCPU*, RTGCPTR, uint64_t*, RTGCPHYS*)â: /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAll/PGMAllGst.h:81:17: error: âPdpe.X86PDPE::lm.X86PDPEAMD64BITS::u1Writeâ may be used uninitialized in this function [-Wuninitialized] /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAll/PGMAllGst.h:81:17: error: âPdpe.X86PDPE::lm.X86PDPEAMD64BITS::u1Userâ may be used uninitialized in this function [-Wuninitialized] /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAll/PGMAllGst.h:81:17: error: âPdpe.X86PDPE::lm.X86PDPEAMD64BITS::u1Accessedâ may be used uninitialized in this function [-Wuninitialized] /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAll/PGMAllGst.h:81:17: error: âPdpe.X86PDPE::lm.X86PDPEAMD64BITS::u1NoExecuteâ may be used uninitialized in this function [-Wuninitialized] /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAll/PGMAllGst.h:81:17: error: âPdpe.X86PDPE::n.X86PDPEBITS::u1Presentâ may be used uninitialized in this function [-Wuninitialized]

Attachments

VirtualBox-gcc-4.5.patch Download (712 bytes) - added by arklinux 4 years ago.
Adapt configure check
VirtualBox-3.2.0-gcc-4.5-warning-workaround.patch Download (523 bytes) - added by arklinux 4 years ago.
Workaround for the (apparently bogus) warning produced by gcc 4.5

Change History

Changed 4 years ago by arklinux

Adapt configure check

Changed 4 years ago by arklinux

Workaround for the (apparently bogus) warning produced by gcc 4.5

comment:1 Changed 4 years ago by frank

First, your patch to configure does not apply. I don't know where you downloaded the 3.2.0 OSE sources but the sources from the  official site contain a configure script which is aware of gcc-4.5.

To workaround the -Werror issues you can add

VBOX_WITH_WARNINGS_AS_ERRORS :=

to a file LocalConfig.kmk which you put into the root directory of your tree.

comment:2 Changed 4 years ago by luizluca

Hello,

I also have problems with "gcc (SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292]" for trunk and 3.6.4. This is avaiable in OpenSUSE 11.3 x86_64:

cc1plus: warnings being treated as errors
/mnt/dados/devel/vbox/src/VBox/Devices/Network/SrvIntNetR0.cpp: In function ‘void intnetR0TrunkIfSend(INTNETTRUNKIF*, INTNETNETWORK*, INTNETIF*, uint32_t, INTNETSG*)’:
/mnt/dados/devel/vbox/src/VBox/Devices/Network/SrvIntNetR0.cpp:2571:21: error: array subscript is above array bounds [-Warray-bounds]
/mnt/dados/devel/vbox/src/VBox/Devices/Network/SrvIntNetR0.cpp:2572:21: error: array subscript is above array bounds [-Warray-bounds]
/mnt/dados/devel/vbox/src/VBox/Devices/Network/SrvIntNetR0.cpp:2573:21: error: array subscript is above array bounds [-Warray-bounds]
kBuild: Generating python - /mnt/dados/devel/vbox/out/linux.amd64/debug/obj/VBoxOGLgen/unpack_extend.h

I'll use the workarround

comment:3 Changed 3 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

Fixed long time ago.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use