Re: -current build failure

看板FB_current作者時間13年前 (2012/07/21 07:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串5/21 (看更多)
--L/iKGr82HRlWSTal Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 20, 2012 at 10:07:05PM +0100, David Chisnall wrote: > On 20 Jul 2012, at 17:33, Konstantin Belousov wrote: >=20 > > It is not related to dtrace at all, and indeed OFFSETOF_CURTHREAD is 0. > > This is a bug in clang, we compile our kernel in freestanding environme= nt. >=20 > The copies of the C spec that I have do not differentiate between > freestanding and hosted environments for the validity of dereferencing > a pointer value of 0. Doing so is undefined in all cases and any > standards-compliant compiler is quite at liberty to eat your dog in > such situations - it is explicitly not guaranteed to read the memory at > linear address 0 (this is undefined for at least two reasons that I can > think of from the C spec, and probably more). Ok, I stand corrected. But the standard does not say what you claim either. It only specifies that NULL pointer is unequal to any pointer to object or function (implicitely saying that you can create a C object or function pointer to which is equal to NULL). So, lets reformulate it other way: freestanding implementation in clang has no use, at least for general purpose kernel. Especially ridiculous is the fact that clang throws it hands for asm inline wanting to get null address, on the machine with linearly addressable memory. --L/iKGr82HRlWSTal Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlAJ5rQACgkQC3+MBN1Mb4jFBwCeNynqYSEs0hhXIVzuT6mcAF3z 4N0AoMVBYHc0Us5/PMHheJOFS7lPYA4X =eoI9 -----END PGP SIGNATURE----- --L/iKGr82HRlWSTal--
文章代碼(AID): #1G2Ufpeb (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1G2Ufpeb (FB_current)