Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 May 2013 12:59:31 -0400
From:      "Mikhail T." <mi+thun@aldan.algebra.com>
To:        ports@FreeBSD.org, gerald@FreeBSD.org
Cc:        dim@FreeBSD.org
Subject:   Why can't lang/gcc4X compilers build kernel modules?
Message-ID:  <518D2773.40504@aldan.algebra.com>

next in thread | raw e-mail | index | archive | help
It seems, none of the gcc-ports have the FreeBSD-extensions, that are worked 
into the base cc. This is fine for regular ports, but the consumers of 
bsd.kmod.mk (such as print/acroreadwrapper or multimedia/cuse4bsd-kmod) all 
choke. For example:

    gcc46 -O2 -pipe -march=prescott -fno-strict-aliasing -Werror -D_KERNEL
    -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000
    --param inline-unit-growth=100 --param large-function-growth=1000
    -fno-common  -mno-align-long-strings -mpreferred-stack-boundary=2  -mno-mmx
    -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -std=iso9899:1999
    -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
    -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef
    -Wno-pointer-sign -fformat-extensions -c linux_adobe.c
    cc1: error: unrecognized command line option '-mno-align-long-strings'
    cc1: error: unrecognized command line option '-fformat-extensions'
    *** Error code 1

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?

Once implemented, it would become easier to build the entire kernel using a 
newer compiler. And dim@ (CC-ed) has already demonstrated non-trivial speed-ups 
obtained by building the kernel with gcc-4.7 over gcc-4.2:

    http://lists.freebsd.org/pipermail/freebsd-current/2012-November/037842.html
    http://www.andric.com/freebsd/perftest/perftest-kernel-2012-09-25b.txt

Yours,

    -mi




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?518D2773.40504>