On May 17, 2013, at 22:46, Lev Serebryakov <l...@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 _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"