Date: Fri, 17 May 2013 23:35:25 +0200 From: Dimitry Andric <dim@FreeBSD.org> To: lev@FreeBSD.org Cc: freebsd-current@freebsd.org, Brooks Davis <brooks@FreeBSD.org> Subject: Re: WITHOUT_CLANG + WITHOUT_GCC vs XCC + WITHOUT_CROSS_COMPILER Message-ID: <FD22E076-B21B-496C-AE48-89CA2430A599@FreeBSD.org> In-Reply-To: <1713488536.20130518004618@serebryakov.spb.ru> References: <1713488536.20130518004618@serebryakov.spb.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On May 17, 2013, at 22:46, Lev Serebryakov <lev@freebsd.org> wrote: > I've explored new options to build world and kernel with external > compiler. My goal is not to use "modern" compiler or "true" > cross-compilation, but fast building of system, which (almost) > identical to host system and doesn't need compiler (NanoBSD image for > router). > > What I found, that if WITHOUT_LCNAG and WITHOUT_GCC are both set, and > WITHOUT_CROSS_COMPILER and XCC/XCXX/XCPP are NOT set, world and > kernel is build with "system" compiler, but without "cross" options > (like -isystem and --sysroot). So, it works only by accident, and not > in way, that user (developer) could expect. For some historic reason, the cross-tools compiler is always built with its default "sysroot" path set to ${WORLDTMP}. I used quotes, because it is not only about finding headers and libraries, but also to find other toolchain binaries (cc1, as, ld and so on) under ${WORLDTMP}. I suspect this was all done before gcc and the other toolchain components grew proper sysroot support. Indeed, it would probably be better to revert that, and compile all stages after cross-tools with --sysroot=${WORLDTMP} (and probably -B${WORLDTMP}/usr/bin). It might not be trivial to get this properly working for all edge cases, though. > What I expected, that in such case cross-clang will be built at > "stage 3: cross tools" and used to build world, but no clang (And > support libraries) or gcc will be built at "stage 4.4: building > everything". Currently, if you set WITHOUT_CLANG, it will not build clang, not in any stage. Similar for WITHOUT_GCC. > Do we need such mode? Well, if you are not interested in having any compilers (or toolchain components) in your final world, they should not be built, right? > Is current behavior (risky on, IMHO) Ok? No, obviously not. If you build world with "old" system headers (for example when building head on stable/9), there will be trouble. > I think, ideal situation is when WITHOUT_CLANG + WITHOUT_GCC but no > WITHOUT_CROSS_COMPILER IS supported "as expected" > (compiler-as-cross-tool is built, but compiler-as-part-of-everything > is not), but at least system need to abort "both compilers are > disabled and no cross-tools set" configuration for now, am I right? Yes, a seatbelt would probably be wise for the time being. -Dimitry
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FD22E076-B21B-496C-AE48-89CA2430A599>