Rafal Boni | 6 Mar 2008 04:11
Picon
Favicon

-current kernel headers vs. MS VC compiler

Folks:
	It looks like changes to the kernel headers over the last couple of 
months have broken the ability to build things that rely on libsa, etc. 
with compilers other than GCC & PCC.  Specifically, I can no longer 
build hpcboot.exe with MS eMbedded Visual C++ 4.0 after upgrading my 
kernel tree to the head of trunk.

	The first change that bit me was a change from the old 
'__attribute__((packed))', which used to be defined away on non-GCC 
compilers (probably incorrectly, but nonetheless) to using '__packed', 
in sys/ufs/ffs/fs.h:

	RCS file: /cvsroot/src/sys/ufs/ffs/fs.h,v
	Working file: fs.h
	head: 1.49
	----------------------------
	revision 1.49
	date: 2007/12/25 18:33:49;  author: perry;  state: Exp;  lines: +2 -2
	Convert many of the uses of __attribute__ to equivalent
	__packed, __unused and __dead macros from cdefs.h

I've 'fixed' this with the following change, because I don't know how to 
make the MS compiler #pragma pack fit into the syntax we require (nor 
was I able to find an MS compiler extension which looked it it might help):

Index: cdefs.h
===================================================================
RCS file: /cvsroot/src/sys/sys/cdefs.h,v
retrieving revision 1.66
diff -u -p -r1.66 cdefs.h
(Continue reading)

Joerg Sonnenberger | 7 Mar 2008 14:04
Picon

Re: -current kernel headers vs. MS VC compiler

On Wed, Mar 05, 2008 at 10:11:26PM -0500, Rafal Boni wrote:
> 	It looks like changes to the kernel headers over the last couple of months 
> have broken the ability to build things that rely on libsa, etc. with 
> compilers other than GCC & PCC.  Specifically, I can no longer build 
> hpcboot.exe with MS eMbedded Visual C++ 4.0 after upgrading my kernel tree 
> to the head of trunk.

Does Microsoft's compiler have a switch for C99 support? long long is
standard compliant syntax after all. If it doesn't grok that, IMO it is
not really worth supporting.

Joerg

Valeriy E. Ushakov | 7 Mar 2008 14:12
Picon

Re: -current kernel headers vs. MS VC compiler

On Fri, Mar 07, 2008 at 14:04:37 +0100, Joerg Sonnenberger wrote:

> On Wed, Mar 05, 2008 at 10:11:26PM -0500, Rafal Boni wrote:
>
> > It looks like changes to the kernel headers over the last couple of months 
> > have broken the ability to build things that rely on libsa, etc. with 
> > compilers other than GCC & PCC.  Specifically, I can no longer build 
> > hpcboot.exe with MS eMbedded Visual C++ 4.0 after upgrading my kernel tree 
> > to the head of trunk.
> 
> Does Microsoft's compiler have a switch for C99 support? long long is
> standard compliant syntax after all. If it doesn't grok that, IMO it is
> not really worth supporting.

No, those compilers are not C99 and there's no switch.  We cannot "no
support them" b/c that's the only way we can build the bootloader for
hpc ports.

One option (that we already use for endian.h) is to make a private
copy of cdefs.h for use with hpcboot.

SY, Uwe
--

-- 
uwe <at> stderr.spb.ru                       |       Zu Grunde kommen
http://snark.ptc.spbu.ru/~uwe/          |       Ist zu Grunde gehen


Gmane