Why can't lang/gcc4X compilers build kernel modules?

Gerald Pfeifer gerald at pfeifer.com
Wed Nov 27 23:14:20 UTC 2013


On Fri, 10 May 2013, Dimitry Andric wrote:
> On May 10, 2013, at 18:59, Mikhail T. <mi+thun at aldan.algebra.com> wrote:
>> Would it be too much work to extend the port-installed compilers the 
>> same way gcc-4.2.1 in the base is extended? May be not for gcc4[89], 
>> which are complete rewrites, but for 4.[4-7]? If not too difficult, 
>> should it be done?
> 
> In my opinion, this is a fruitless direction.  Neither upstream gcc, nor
> upstream clang will ever accept an option called "-fformat-extensions",
> which enables FreeBSD kernel-specific format extensions (which might
> also change in the future, so you do not really gain anything).
> 
> I think the best solution is to get rid of all non-standard printf
> format specifiers in the kernel, and use custom formatters for our
> specialized needs.  For replacing the %b specifier, for example, we
> could use NetBSD's snprintb() (see
> <http://netbsd.gw.com/cgi-bin/man-cgi?snprintb+3+NetBSD-current>).
> 
> Getting rid of non-standard extensions in general is really the way to
> go.  This would enable compiling with any standards-compliant compiler,
> even commercial ones.

Amen.

Gerald


More information about the freebsd-ports mailing list