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)

2017-06-29 Thread Mark Millard
[Good news from the llvm side of things. . .]

On 2017-Jun-29, at 3:47 AM, Dimitry Andric  wrote:

> On 29 Jun 2017, at 12:04, Mark Millard  wrote:
>> 
>> [The libc++ code in question appears to not be ready for
>> 32-bit contexts with 64 bit times. Disable
>> experimental/filesystem for now? I've submitted
>> llvm bugzilla 33638 for the issue and have
>> added it to llvm's 25780, the FreeBSD META for
>> clang.]
> 
> Yes, this also broke earlier on arm and mips, which is why there is the
> following in lib/Makefile:
> 
> .if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
> _libcplusplus+= libc++experimental
> .endif
> 
> I haven't yet found the time to address this issue.  Upstream should
> already be aware of it, though.
> 
> One nasty problem with this is that it is not possible to figure out at
> compile time what the size of time_t is.  You always need some sort of
> configure-time test, and an external define.

I got a notice of a pending patch for the issue:

Begin forwarded message:

From: bugzilla-daemon at llvm.org
Subject: [Bug 33638] FreeBSD head -r320347 moved TARGET_ARCH=powerpc to 64-bit 
time_t but now experimental/filesystem/operations.cpp fails static_asserts and 
such
Date: June 29, 2017 at 10:23:56 AM PDT
. . .
Comment # 2 on bug 33638 from Eric Fiselier
I have a patch for this waiting in the wings. I should be able to get to it
next week


===
Mark Millard
markmi at dsl-only.net

___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


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)

2017-06-29 Thread Mark Millard
On 2017-Jun-29, at 5:54 AM, Konstantin Belousov  wrote:
> 
> On Thu, Jun 29, 2017 at 12:47:10PM +0200, Dimitry Andric wrote:
>> One nasty problem with this is that it is not possible to figure out at
>> compile time what the size of time_t is.  You always need some sort of
>> configure-time test, and an external define.
> 
> It is arguably possible, with constexpr.

I took Dimitry's wording as probably referring to
testing the size in the C/C++ preprocessor like
the original code tests for __LP64__ being defined
vs. not to control what it does: extending that to
involve more preprocessor tests to pick from more
code blocks. (But it is a guess given his wording.)

I also took him to be excluding C++17's if-constexpr
(or that the limitations in where how it can be used
would prevent his intent) --and excluding the types of
meta-programming/Substitution-Failure-Is-Not-An-Error
usage that if-constexpr can simplify: too much rework
of parts of libc++.

Net result: extending the Makefile's "if" that he
referenced with a powerpc-family test removes
something in more contexts than have the problem.
I think that he was wishing for a simple way to
avoid that loss but still prevent the problem
cases.

===
Mark Millard
markmi at dsl-only.net

___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


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)

2017-06-29 Thread Konstantin Belousov
On Thu, Jun 29, 2017 at 12:47:10PM +0200, Dimitry Andric wrote:
> One nasty problem with this is that it is not possible to figure out at
> compile time what the size of time_t is.  You always need some sort of
> configure-time test, and an external define.

It is arguably possible, with constexpr.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


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)

2017-06-29 Thread Dimitry Andric
On 29 Jun 2017, at 12:04, Mark Millard  wrote:
> 
> [The libc++ code in question appears to not be ready for
> 32-bit contexts with 64 bit times. Disable
> experimental/filesystem for now? I've submitted
> llvm bugzilla 33638 for the issue and have
> added it to llvm's 25780, the FreeBSD META for
> clang.]

Yes, this also broke earlier on arm and mips, which is why there is the
following in lib/Makefile:

.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
_libcplusplus+= libc++experimental
.endif

I haven't yet found the time to address this issue.  Upstream should
already be aware of it, though.

One nasty problem with this is that it is not possible to figure out at
compile time what the size of time_t is.  You always need some sort of
configure-time test, and an external define.

-Dimitry



signature.asc
Description: Message signed with OpenPGP


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)

2017-06-29 Thread Mark Millard
[The libc++ code in question appears to not be ready for
32-bit contexts with 64 bit times. Disable
experimental/filesystem for now? I've submitted
llvm bugzilla 33638 for the issue and have
added it to llvm's 25780, the FreeBSD META for
clang.]

On 2017-Jun-29, at 2:21 AM, Mark Millard  wrote:

> [TARGET_ARCH=powerpc64 fails similarly in its world32
> part of its build.]
> 
> On 2017-Jun-29, at 1:33 AM, Mark Millard  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, 9}), "");
>> ^ ~
>> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:580:1: 
>> error: static_assert failed ""
>> static_assert(is_representable({max_time_t, 10}), "");
>> ^ ~~
>> /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 
>> 922337203685477580700 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, 
>> std::__1::chrono::duration > 
>> >()->operator()(seconds(max_time_t))'
>>   return __duration_cast, _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(__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 
>> -922337203685477580800 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, 
>> std::__1::chrono::duration > 
>> >()->operator()(seconds(min_time_t))'
>>   return __duration_cast, _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(__d).count()) 
>> {}
>>^
>> /usr/src/contrib/libc++/include/__config:390:15: note: expanded from macro 
>> '_VSTD'
>> #define _VSTD std::_LIBCPP_NAMESPACE
>> ^
>> 

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)

2017-06-29 Thread Mark Millard
[TARGET_ARCH=powerpc64 fails similarly in its world32
part of its build.]

On 2017-Jun-29, at 1:33 AM, Mark Millard  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, 9}), "");
> ^ ~
> /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp:580:1: 
> error: static_assert failed ""
> static_assert(is_representable({max_time_t, 10}), "");
> ^ ~~
> /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 
> 922337203685477580700 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, 
> std::__1::chrono::duration > 
> >()->operator()(seconds(max_time_t))'
>return __duration_cast, _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(__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 
> -922337203685477580800 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, 
> std::__1::chrono::duration > 
> >()->operator()(seconds(min_time_t))'
>return __duration_cast, _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(__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
>