Bug 198232

Summary: devel/kBuild: fix build with clang [PATCH]
Product: Ports & Packages Reporter: Matthieu Volat <mazhe>
Component: Individual Port(s)Assignee: Virtualbox Team (Nobody) <vbox>
Status: Closed Works As Intended    
Severity: Affects Only Me CC: pi
Priority: --- Keywords: patch
Version: LatestFlags: bugzilla: maintainer-feedback? (vbox)
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Fix building with clang none

Description Matthieu Volat 2015-03-03 17:23:11 UTC
Created attachment 153717 [details]
Fix building with clang

Hi,

If somebody find the following of interest, browsing through current dev tree of kBuild(1)(2) gave me the answer to fix building the port with clang, even if I could not find how originally gcc worked around a 4th main() parameter...

See patch attached. I allows to build kBuild, and emulators/virtualbox-ose and emulators/virtualbox-ose also build and works fine under amd64 (given the patch, I do not expect issues with i386 either).

(1) http://trac.netlabs.org/kbuild/browser/trunk/src/kmk/kmkbuiltin/test.c
(2) http://trac.netlabs.org/kbuild/browser/trunk/src/kmk/kmkbuiltin.h
Comment 1 Matthieu Volat 2015-03-07 10:59:53 UTC
Sorry, with the last virtualbox-ose, it seems that not using gcc do build kDevel (with or without the rest of the patch) will break virtualbox-ose building with an error:

kBuild: Compiling VBoxRemPrimary - /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.3.24/src/recompiler/cpu-exec.c
In file included from /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.3.24/src/recompiler/cpu-exec.c:30:
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.3.24/src/recompiler/target-i386/exec.h:41:30: error: 
      global register variables are not supported
register struct CPUX86State *env asm(AREG0);
                             ^

Anybody can close the issue :(