Can not compile VirtualBox-OSE with clang

Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

Can not compile VirtualBox-OSE with clang

Postby miracle20003 » 02 Jul 2012, 12:55

[CMD=""] uname -an [/CMD]
Code: Select all
FreeBSD Setp-By-Setp 9.0-STABLE FreeBSD 9.0-STABLE #0 r237949M: Mon Jul  2 16:07:13 CST 2012
root@Setp-By-Setp:/usr/obj/usr/src_9/sys/XXIXX  i38


Here is my [FILE]/etc/make.conf[/FILE]:
Code: Select all
.if ${.CURDIR:M/usr/src} || ${.CURDIR:M/usr/src/*} || ${.CURDIR:M/usr/obj} || ${.CURDIR:M/usr/obj/*} || ${.CURDIR:M/sys} || ${.CURDIR:M/sys/*}
CFLAGS+= -D_FORTIFY_SOURCE=2
.if !defined(CPP) || ${CPP} == "cpp"
CPP=clang-cpp
.endif
.endif

.if !defined(CC) || ${CC} == "cc"
CC=clang
.endif
.if !defined(CXX) || ${CXX} == "c++"
CXX=clang++
.endif
WITH_CLANG=YES
WITH_CLANG_EXTRAS=YES
#CC=clang
#CXX=clang++
#CPP=clang-cpp
WITH_BIND_LIBS=YES
WITH_BIND_SIGCHASE=YES
WITH_BIND_LARGE_FILE=YES
WITH_IDEA=YES
WITH_HESIOD=YES
NO_WERROR=
WERROR=
WITH_LIBCPLUSPLUS=yes
NO_FSCHG=

CPUTYPE?=athlon64
#KERNCONF=Kernel
#CPUTYPE?=
MAKE_JOBS_NUMBER=4

[FILE]error.log[/FILE]:
Code: Select all
In file included from /work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/src/VBox/VMM/VMMR3/SSM.cpp:150:
/work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/src/VBox/VMM/include/SSMInternal.h:251:1: warning: using extended field designator is an extension [-pedantic,-Wextended-offsetof]
AssertCompile2MemberOffsets(SSMUNIT, u.Common.pvKey,       u.External.pvUser);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/include/iprt/assert.h:396:19: note: expanded from macro 'AssertCompile2MemberOffsets'
    AssertCompile(__builtin_offsetof(type, member1) == __builtin_offsetof(type, member2))
                  ^
/work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/include/iprt/assert.h:312:49: note: expanded from macro 'AssertCompile'
# define AssertCompile(expr)    AssertCompileNS(expr)
                                                ^
/work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/include/iprt/assert.h:299:97: note: expanded from macro 'AssertCompileNS'
# define AssertCompileNS(expr)  extern int RTASSERTVAR[1] __attribute__((unused)), RTASSERTVAR[(expr) ? 1 : 0] __attribute__((unused))
                                                                                                ^~~~
In file included from /work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/src/VBox/VMM/VMMR3/SSM.cpp:150:
/work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/src/VBox/VMM/include/SSMInternal.h:251:1: warning: using extended field designator is an extension [-pedantic,-Wextended-offsetof]
AssertCompile2MemberOffsets(SSMUNIT, u.Common.pvKey,       u.External.pvUser);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/include/iprt/assert.h:396:56: note: expanded from macro 'AssertCompile2MemberOffsets'
    AssertCompile(__builtin_offsetof(type, member1) == __builtin_offsetof(type, member2))
                                                       ^
/work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/include/iprt/assert.h:312:49: note: expanded from macro 'AssertCompile'
# define AssertCompile(expr)    AssertCompileNS(expr)
                                                ^
/work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/include/iprt/assert.h:299:97: note: expanded from macro 'AssertCompileNS'
# define AssertCompileNS(expr)  extern int RTASSERTVAR[1] __attribute__((unused)), RTASSERTVAR[(expr) ? 1 : 0] __attribute__((unused))
                                                                                                ^~~~
78 warnings generated.
kBuild: Compiling NetBiosBin - /work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/src/VBox/Devices/PC/Etherboot-src/arch/i386/prefix/romprefix.S
clang: warning: argument unused during compilation: '-fstrength-reduce'
/work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/src/VBox/Devices/PC/Etherboot-src/arch/i386/prefix/romprefix.S:46:9: error: .code16 not supported yet
 .code16
        ^
/work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/src/VBox/Devices/PC/Etherboot-src/arch/i386/prefix/romprefix.S:47:2: warning: ignoring directive for now
 .arch i386
 ^
kmk: *** [/work/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.16/out/freebsd.x86/release/obj/pciprefix.o] Error 1
kmk: *** Waiting for unfinished jobs....
61 warnings generated.
kmk: *** Exiting with status 2
*** [do-build] Error code 2

Stop in /work/ports/emulators/virtualbox-ose.
*** [install] Error code 1

Stop in /work/ports/emulators/virtualbox-ose.


How to fix it? Thanks.
miracle20003
Junior Member
 
Posts: 23
Joined: 08 May 2012, 16:29

Postby kpa » 02 Jul 2012, 14:21

Please see http://wiki.freebsd.org/PortsAndClang, especially the part "If you're interested in helping". Clang is not yet in a state where it can fully replace the old [man=1]gcc[/man] so if you're not interested in figuring out how to fix this type of problems yourself you should compile the problem ports with the base system [man=1]gcc[/man].
kpa
MFC'd
 
Posts: 3381
Joined: 05 Jul 2010, 13:19
Location: People's Technocratic Republic of Finland


Return to Installation and Maintenance of FreeBSD Ports or Packages

Who is online

Users browsing this forum: No registered users and 3 guests