Re: head -r320458 (e.g.) amd64 -> powerpc (32-bit) cross-buildworld fails for time libc++ static_asserts and overflow/underflow of long long (system clang/clang++ 4 based build)

From: Mark Millard <markmi_at_dsl-only.net>
Date: Thu, 29 Jun 2017 02:21:38 -0700
[TARGET_ARCH=powerpc64 fails similarly in its world32
part of its build.]

On 2017-Jun-29, at 1:33 AM, Mark Millard <markmi_at_dsl-only.net> wrote:

> Beyond static_assert failures and overflow/underflow of long long
> it also it complains in some cases about:
> 
> static_assert expression is not an integral constant expression
> 
> 
> [I will note that attempting a gcc 4.2.1 build did not
> stop and report such things for its libstdc++. The below
> is somehow libc++ and/or clang 4 specific.]
> 
> 
> Context:
> 
> # uname -apKU
> FreeBSD FreeBSDx64OPC 12.0-CURRENT FreeBSD 12.0-CURRENT  r320458M  amd64 amd64 1200036 1200036
> 
> buildworld for TARGET_ARCH=powerpc resulted in:
> 
> --- filesystem/operations.o ---
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:579:1: error: static_assert failed ""
> static_assert(is_representable({max_time_t, 999999999}), "");
> ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:580:1: error: static_assert failed ""
> static_assert(is_representable({max_time_t, 1000000000}), "");
> ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:581:1: error: static_assert failed ""
> static_assert(is_representable({min_time_t, 0}), "");
> ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:603:1: error: static_assert failed ""
> static_assert(!is_representable(file_time_type::max()), "");
> ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:604:1: error: static_assert failed ""
> static_assert(!is_representable(file_time_type::min()), "");
> ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:605:15: error: static_assert expression is not an integral constant expression
> static_assert(is_representable(file_time_type(seconds(max_time_t))), "");
>              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/include/chrono:386:59: note: value 9223372036854775807000000 is outside the range of representable values of type 'long long'
>                           static_cast<_Ct>(__fd.count()) * static_cast<_Ct>(_Period::num)));
>                                                          ^
> /usr/src/contrib/libc++/include/chrono:413:12: note: in call to '&__duration_cast<duration<long long, std::__1::ratio<1, 1> >, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000> > >()->operator()(seconds(max_time_t))'
>    return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd);
>           ^
> /usr/src/contrib/libc++/include/chrono:560:26: note: in call to 'duration_cast(seconds(max_time_t))'
>                : __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}
>                         ^
> /usr/src/contrib/libc++/include/__config:390:15: note: expanded from macro '_VSTD'
> #define _VSTD std::_LIBCPP_NAMESPACE
>              ^
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:605:47: note: in call to 'duration(seconds(max_time_t), 0)'
> static_assert(is_representable(file_time_type(seconds(max_time_t))), "");
>                                              ^
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:606:15: error: static_assert expression is not an integral constant expression
> static_assert(is_representable(file_time_type(seconds(min_time_t))), "");
>              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/include/chrono:386:59: note: value -9223372036854775808000000 is outside the range of representable values of type 'long long'
>                           static_cast<_Ct>(__fd.count()) * static_cast<_Ct>(_Period::num)));
>                                                          ^
> /usr/src/contrib/libc++/include/chrono:413:12: note: in call to '&__duration_cast<duration<long long, std::__1::ratio<1, 1> >, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000> > >()->operator()(seconds(min_time_t))'
>    return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd);
>           ^
> /usr/src/contrib/libc++/include/chrono:560:26: note: in call to 'duration_cast(seconds(min_time_t))'
>                : __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}
>                         ^
> /usr/src/contrib/libc++/include/__config:390:15: note: expanded from macro '_VSTD'
> #define _VSTD std::_LIBCPP_NAMESPACE
>              ^
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:606:47: note: in call to 'duration(seconds(min_time_t), 0)'
> static_assert(is_representable(file_time_type(seconds(min_time_t))), "");
>                                              ^
> . . .
> --- lib__L ---
> 7 errors generated.
> *** [filesystem/operations.o] Error code 1
> 
> make[5]: stopped in /usr/src/lib/libc++experimental
> .ERROR_TARGET='filesystem/operations.o'
> .ERROR_META_FILE='/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/lib/libc++experimental/_usr_obj_powerpcvtsc_clang_powerpc.powerpc_usr_src_lib_libc++experimental_filesystem_operations.o.meta'
> .MAKE.LEVEL='5'
> MAKEFILE=''
> .MAKE.MODE='meta missing-filemon=yes missing-meta=yes silent=yes verbose'
> _ERROR_CMD='c++  -target powerpc-unknown-freebsd12.0 --sysroot=/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp -B/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/usr/bin  -O2 -pipe -fstack-protector-strong -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -Qunused-arguments  -fpic -isystem /usr/src/contrib/libc++/include -nostdinc++ -nostdlib -D_LIBCPP_BUILDING_LIBRARY -DLIBCXXRT -std=c++14 -Wno-c++11-extensions  -c /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp -o filesystem/operations.o;'
> .CURDIR='/usr/src/lib/libc++experimental'
> 
> 
> # more /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/lib/libc++experimental/_usr_obj_powerpcvtsc_clang_powerpc.powerpc_usr_src_lib_libc++experimental_filesystem_operations.o.meta
> # Meta data file /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/lib/libc++experimental/_usr_obj_powerpcvtsc_clang_powerpc.powerpc_usr_src_lib_libc++experimental_filesystem_operations.o.meta
> CMD c++  -target powerpc-unknown-freebsd12.0 --sysroot=/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp -B/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/usr/bin  -O2 -pipe -fstack-protector-strong -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -Qunused-arguments  -fpic -isystem /usr/src/contrib/libc++/include -nostdinc++ -nostdlib -D_LIBCPP_BUILDING_LIBRARY -DLIBCXXRT -std=c++14 -Wno-c++11-extensions  -c /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp -o filesystem/operations.o
> CWD /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/lib/libc++experimental
> TARGET filesystem/operations.o
> -- command output --
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:579:1: error: static_assert failed ""
> static_assert(is_representable({max_time_t, 999999999}), "");
> ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:580:1: error: static_assert failed ""
> static_assert(is_representable({max_time_t, 1000000000}), "");
> ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:581:1: error: static_assert failed ""
> static_assert(is_representable({min_time_t, 0}), "");
> ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:603:1: error: static_assert failed ""
> static_assert(!is_representable(file_time_type::max()), "");
> ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:604:1: error: static_assert failed ""
> static_assert(!is_representable(file_time_type::min()), "");
> ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:605:15: error: static_assert expression is not an integral constant expression
> static_assert(is_representable(file_time_type(seconds(max_time_t))), "");
>              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/include/chrono:386:59: note: value 9223372036854775807000000 is outside the range of representable values of type 'long long'
>                           static_cast<_Ct>(__fd.count()) * static_cast<_Ct>(_Period::num)));
>                                                          ^
> /usr/src/contrib/libc++/include/chrono:413:12: note: in call to '&__duration_cast<duration<long long, std::__1::ratio<1, 1> >, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000> > >()->operator()(seconds(max_time_t))'
>    return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd);
>           ^
> /usr/src/contrib/libc++/include/chrono:560:26: note: in call to 'duration_cast(seconds(max_time_t))'
>                : __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}
>                         ^
> /usr/src/contrib/libc++/include/__config:390:15: note: expanded from macro '_VSTD'
> #define _VSTD std::_LIBCPP_NAMESPACE
>              ^
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:605:47: note: in call to 'duration(seconds(max_time_t), 0)'
> static_assert(is_representable(file_time_type(seconds(max_time_t))), "");
>                                              ^
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:606:15: error: static_assert expression is not an integral constant expression
> static_assert(is_representable(file_time_type(seconds(min_time_t))), "");
>              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/src/contrib/libc++/include/chrono:386:59: note: value -9223372036854775808000000 is outside the range of representable values of type 'long long'
>                           static_cast<_Ct>(__fd.count()) * static_cast<_Ct>(_Period::num)));
>                                                          ^
> /usr/src/contrib/libc++/include/chrono:413:12: note: in call to '&__duration_cast<duration<long long, std::__1::ratio<1, 1> >, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000> > >()->operator()(seconds(min_time_t))'
>    return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd);
>           ^
> /usr/src/contrib/libc++/include/chrono:560:26: note: in call to 'duration_cast(seconds(min_time_t))'
>                : __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}
>                         ^
> /usr/src/contrib/libc++/include/__config:390:15: note: expanded from macro '_VSTD'
> #define _VSTD std::_LIBCPP_NAMESPACE
>              ^
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:606:47: note: in call to 'duration(seconds(min_time_t), 0)'
> static_assert(is_representable(file_time_type(seconds(min_time_t))), "");
>                                              ^
> 7 errors generated.
> *** Error code 1
> 
> 
> 
> Build configuration:
> 
> 
> # svnlite info /usr/src/ | grep "Re[plv]"
> Relative URL: ^/head
> Repository Root: svn://svn.freebsd.org/base
> Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
> Revision: 320458
> Last Changed Rev: 320458
> 
> 
> # more ~/sys_build_scripts.amd64-host/make_powerpcvtsc_nodebug_clang_bootstrap-amd64-host.sh 
> kldload -n filemon && \
> script ~/sys_typescripts/typescript_make_powerpcvtsc_nodebug_clang_bootstrap-amd64-host-$(date +%Y-%m-%d:%H:%M:%S) \
> env __MAKE_CONF="/root/src.configs/make.conf" SRCCONF="/dev/null" SRC_ENV_CONF="/root/src.configs/src.conf.powerpc-clang-bootstrap.amd64-host" \
> WITH_META_MODE=yes \
> MAKEOBJDIRPREFIX="/usr/obj/powerpcvtsc_clang" \
> make $*
> 
> 
> # more /root/src.configs/src.conf.powerpc-clang-bootstrap.amd64-host
> TO_TYPE=powerpc
> #
> KERNCONF=GENERICvtsc-NODBG
> TARGET=${TO_TYPE}
> .if ${.MAKE.LEVEL} == 0
> TARGET_ARCH=${TO_TYPE}
> .export TARGET_ARCH
> .endif
> #
> WITH_CROSS_COMPILER=
> WITHOUT_SYSTEM_COMPILER=
> #
> WITH_LIBCPLUSPLUS=
> WITH_BINUTILS_BOOTSTRAP=
> WITH_ELFTOOLCHAIN_BOOTSTRAP=
> WITH_CLANG_BOOTSTRAP=
> WITH_CLANG=
> WITH_CLANG_IS_CC=
> WITH_CLANG_FULL=
> WITH_CLANG_EXTRAS=
> WITH_LLD=
> # lldb requires missing atomic 8-byte operations for powerpc (non-64)
> WITHOUT_LLDB=
> #
> WITH_BOOT=
> WITHOUT_LIB32=
> #
> WITHOUT_GCC_BOOTSTRAP=
> WITHOUT_GCC=
> WITHOUT_GCC_IS_CC=
> WITHOUT_GNUCXX=
> #
> NO_WERROR=
> #
> # Use WERROR to avoid stopping at the likes of:
> # error: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes value from 128 to -128 [-Werror,-Wconstant-conversion]
> WERROR=
> MALLOC_PRODUCTION=
> #
> WITH_REPRODUCIBLE_BUILD=
> WITH_DEBUG_FILES=


The world32 part of a TARGET_ARCH=powerpc64 cross-buildworld
also gets the same errors.

===
Mark Millard
markmi at dsl-only.net
Received on Thu Jun 29 2017 - 07:21:43 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:12 UTC