Problems with buildworld when WITHOUT_CLANG and WITHOUT_GCC are both set -- waring settings are selected not by used compiler, but by built one, what is plainly wrong.

From: Lev Serebryakov <lev_at_FreeBSD.org>
Date: Fri, 17 May 2013 00:03:30 +0400
Hello, Freebsd-current.

 Now, after Brook Davis work, it is possible to build world with both
WITHOUT_CLANGF and WITHOUT_GCC set. Or it isn't?

 Problem is, that when WITHOUT_CLANG is set, all warning-suppression
options are set as fro GCC. What is plainly wrong. buildworld fails:

/usr/bin/cc --sysroot=/data/obj.nano/gateway.v2/data/src/tmp -B/data/obj.nano/gateway.v2/data/src/tmp/usr/bin -fpic -DPIC  -O2 -pipe  -I/data/src/lib/libc/include -I/data/src/lib/libc/../../include -I/data/src/lib/libc/amd64  -D__DBINTERFACE_PRIVATE -I/data/src/lib/libc/../../contrib/gdtoa -I/data/src/lib/libc/../../contrib/libc-vis -DINET6 -I/data/obj.nano/gateway.v2/data/src/lib/libc -I/data/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/data/src/lib/libc/../../contrib/jemalloc/include -DMALLOC_PRODUCTION -I/data/src/lib/libc/../../contrib/tzcode/stdtime -I/data/src/lib/libc/stdtime  -I/data/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/data/src/lib/libc/rpc -DSYMBOL_VERSIONING -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /data/src/lib/libc/net/ip6opt.c -o ip6opt.So
/data/src/lib/libc/net/ip6opt.c:384:13: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
        if (extlen < 0 || (extlen % 8))
            ~~~~~~ ^ ~
/data/src/lib/libc/net/ip6opt.c:413:10: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
        if (len < 0 || len > 255)
            ~~~ ^ ~
2 errors generated.

 And even if corss-compiler is not used, but both "world" compilers
are switched off from build, here is same problem. It is not a
problem, that there is no compiler to use (clang is properly built as
cross-compiler at first stage in this case), it is problem, that
compilation options (warnings suppression) are selected by wrong
knobs. Ok, WITHOUT_CLANG is set, but we use clang to build other
system! We need clang options in such case! And if (when?) gcc as
cross-compiler (without building it for world itself, for second time)
will be usable, we will need to pass gcc options to compiler.

 It looks like, COMPILER_TYPE is not set properly when there are
WITHOUT_CLANG and WITHOUT_GCC are both set.

-- 
// Black Lion AKA Lev Serebryakov <lev_at_FreeBSD.org>
Received on Thu May 16 2013 - 18:03:50 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:37 UTC