From owner-freebsd-ppc@freebsd.org Mon Jun 26 02:34:15 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1F33D9F4A8 for ; Mon, 26 Jun 2017 02:34:15 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 9C1CA16D2 for ; Mon, 26 Jun 2017 02:34:15 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 9884ED9F4A6; Mon, 26 Jun 2017 02:34:15 +0000 (UTC) Delivered-To: ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 982CBD9F4A5 for ; Mon, 26 Jun 2017 02:34:15 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qk0-x234.google.com (mail-qk0-x234.google.com [IPv6:2607:f8b0:400d:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 535B316CB; Mon, 26 Jun 2017 02:34:15 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-qk0-x234.google.com with SMTP id 16so68788081qkg.2; Sun, 25 Jun 2017 19:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to:cc; bh=Dv6008c6JNh3k9CqVo0S5JZtlpSGlt7l22AYQOw5/CA=; b=i3IP7wftp63OZcCc4jFLRDlc/xb6ZZIy9W4ZYD/rnE6qboXnkFGyaSDXLI8IHmv2uf boe0nDLU/tdiKqFdtMgcNAJUQwkQJ4TBddK4MHuF3yiIz5XJal0TFQZZ1BRlieychIuo u/qb7P0uJXfn+ZNZVzv+m9GblC0mmMPIA6pJT3XO6SsQFDN8gZsYH8aAoJBX3jeFzlNt pfJZleYWMxh+f0DBEmiloljTJEaEmMteWz6pRcKkrQ3IENwVg7NiAPONa8dhSNXzgiYK fnwdQVzdlPQ3LmOukXEH7gZNWVzRmN36e9suE2W65BlekOPS5iPtDAA/+INzc0ocU3AE NftA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to:cc; bh=Dv6008c6JNh3k9CqVo0S5JZtlpSGlt7l22AYQOw5/CA=; b=klBXG6Jb7/Tx/BbpA/sinCk4+4YiXFyHAZeZ2wBvg9BNNLW5QIDdQm99oGP4BjNSUC Hb01vHROim+qkgY2QbSeTv56JZ5b9bj8wgHfciE0mtmxhI1Pbu0lnasPE/ZfkZk3KG9o EgnYxE9JHfEB5vwiir7pz/IMnALVmo7lSdZpC0iNc6hMtvPnS/6jc4alwaDALZbejFaR hc2++RqcCSBgyEmXA8iiBeT0Yz0LvVsOCij+NbV4pklMvBAKbQcSqcrsd7M44nvbs6yB ITl/U54FUoQYOGcjJ/+bTKfQF2TRyaa6VlCmwqzGJf1EtZ2/Eijima3jz5ab1vRMSo81 XEbg== X-Gm-Message-State: AKS2vOxJkceZf2axLI3Xd9yPCy6fEHhQ+SzKITjiLAKLYSHvhzOP0eVC IQzqHeJA1uMYYi+UMsTGiS7bewqEfA== X-Received: by 10.55.95.194 with SMTP id t185mr20819643qkb.119.1498444454202; Sun, 25 Jun 2017 19:34:14 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.12.183.143 with HTTP; Sun, 25 Jun 2017 19:34:13 -0700 (PDT) From: Justin Hibbits Date: Sun, 25 Jun 2017 21:34:13 -0500 X-Google-Sender-Auth: jqokDxGLFWNn1NTY43ALULR4JBk Message-ID: Subject: r320347: ABI breakage for 32-bit powerpc, introduction of 64-bit time_t To: ppc@freebsd.org Cc: FreeBSD Release Engineering Team Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 02:34:15 -0000 Hi all, Thanks to the testing by Andreas Tobler, and others, 32-bit powerpc targets (powerpc.powerpc, powerpc.powerpcspe) now use a 64-bit time_t. This is a significant ABI breakage, and as such should be handled with care. For one, live in-place updates cannot be done. You must install via an alternate root. Additionally, all ports, and any local binaries, must be recompiled with the new ABI, or bad/strange/bizarre things could happen. The safest route is to perform a clean install. Second to that, the following procedure could be used to perform an upgrade: * Boot to an alternate medium (CD, DVD, memstick, temporary image on swap, or another hard drive, etc) * Mount your runtime filesystems to, e.g., /mnt * pkg remove -a on your runtime system (in chroot) * Install to /mnt * Rebuild all ports * Reboot to new y2038-safe system - Justin From owner-freebsd-ppc@freebsd.org Mon Jun 26 03:24:31 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10068DA0052 for ; Mon, 26 Jun 2017 03:24:31 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id E8C9C2E73 for ; Mon, 26 Jun 2017 03:24:30 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: by mailman.ysv.freebsd.org (Postfix) id E47A7DA004E; Mon, 26 Jun 2017 03:24:30 +0000 (UTC) Delivered-To: ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E41D6DA004D for ; Mon, 26 Jun 2017 03:24:30 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-43.reflexion.net [208.70.210.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 962B52E6C for ; Mon, 26 Jun 2017 03:24:29 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 14805 invoked from network); 26 Jun 2017 03:24:22 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 26 Jun 2017 03:24:22 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Sun, 25 Jun 2017 23:24:22 -0400 (EDT) Received: (qmail 18555 invoked from network); 26 Jun 2017 03:24:22 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 26 Jun 2017 03:24:22 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 149CDEC7925; Sun, 25 Jun 2017 20:24:22 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: r320347: ABI breakage for 32-bit powerpc, introduction of 64-bit time_t From: Mark Millard In-Reply-To: Date: Sun, 25 Jun 2017 20:24:21 -0700 Cc: ppc@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <0D344289-1A8F-4550-B07B-EFA48E058D5B@dsl-only.net> References: To: Justin Hibbits X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 03:24:31 -0000 [pkg delete -a and pkg remove -a do not work as documented --at least in any context that I've tried. See bugzilla 219979.] On 2017-Jun-25, at 7:34 PM, Justin Hibbits wrote: > Hi all, > > Thanks to the testing by Andreas Tobler, and others, 32-bit powerpc targets > (powerpc.powerpc, powerpc.powerpcspe) now use a 64-bit time_t. This is a > significant ABI breakage, and as such should be handled with care. For > one, live in-place updates cannot be done. You must install via an > alternate root. Additionally, all ports, and any local binaries, must be > recompiled with the new ABI, or bad/strange/bizarre things could happen. > > The safest route is to perform a clean install. Second to that, the > following procedure could be used to perform an upgrade: > > * Boot to an alternate medium (CD, DVD, memstick, temporary image on swap, > or another hard drive, etc) > * Mount your runtime filesystems to, e.g., /mnt > * pkg remove -a on your runtime system (in chroot) Unfortunately pkg delete -a and pkg remove -a stop at pkg itself and do not deal with the rest in the order it processes the packages. (pkg need not be last.) See bugzilla 219979. Even if only pkg was left behind it sounds like pkg also needs to be gotten rid of (creating the powerpc pkg bootstrap problem in its place). The force flag (-f) likely can be used to enable pkg to include itself. I've not tried to know if it deals with the other packages that come after it in its order of going through the packages. > * Install to /mnt > * Rebuild all ports > * Reboot to new y2038-safe system As I remember there is not even a minimal powerpc (or powerpc64) repository that provides only a pkg package for the standard pkg bootstrap. So once pkg is gone it can not be used in its own build/installation sequence until that sequence has established pkg as available. This aspect also applies to the clean-install sequence if I remember right: there is no pkg present after that install. What is available tries to find a repository to get a pkg package from --and fails last I knew. It has been a long time since I've dealt with this issue. === Mark Millard markmi at dsl-only.net From owner-freebsd-ppc@freebsd.org Thu Jun 29 08:33:49 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEEFBD96C70 for ; Thu, 29 Jun 2017 08:33:49 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-15.reflexion.net [208.70.210.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FE7C7B3B8 for ; Thu, 29 Jun 2017 08:33:48 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 3963 invoked from network); 29 Jun 2017 08:33:47 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 29 Jun 2017 08:33:47 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Thu, 29 Jun 2017 04:33:47 -0400 (EDT) Received: (qmail 19474 invoked from network); 29 Jun 2017 08:33:47 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 29 Jun 2017 08:33:47 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 8F5B8EC7E56; Thu, 29 Jun 2017 01:33:46 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: head -r320458 (e.g.) amd64 -> powerpc cross-buildworld fails for time libc++ static_asserts and overflow/underflow of long long (system clang/clang++ 4 based build) Message-Id: Date: Thu, 29 Jun 2017 01:33:45 -0700 To: Justin Hibbits , FreeBSD PowerPC ML , FreeBSD Toolchain , FreeBSD Current X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 08:33:50 -0000 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=3Dpowerpc 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 >, = 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 = -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 >, = 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 .ERROR_TARGET=3D'filesystem/operations.o' = .ERROR_META_FILE=3D'/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=3D'5' MAKEFILE=3D'' .MAKE.MODE=3D'meta missing-filemon=3Dyes missing-meta=3Dyes silent=3Dyes = verbose' _ERROR_CMD=3D'c++ -target powerpc-unknown-freebsd12.0 = --sysroot=3D/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=3Dc++14 = -Wno-c++11-extensions -c = /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp -o = filesystem/operations.o;' .CURDIR=3D'/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=3D/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=3Dc++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 >, = 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 = -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 >, = 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))), = ""); ^ 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-am= d64-host.sh=20 kldload -n filemon && \ script = ~/sys_typescripts/typescript_make_powerpcvtsc_nodebug_clang_bootstrap-amd6= 4-host-$(date +%Y-%m-%d:%H:%M:%S) \ env __MAKE_CONF=3D"/root/src.configs/make.conf" SRCCONF=3D"/dev/null" = SRC_ENV_CONF=3D"/root/src.configs/src.conf.powerpc-clang-bootstrap.amd64-h= ost" \ WITH_META_MODE=3Dyes \ MAKEOBJDIRPREFIX=3D"/usr/obj/powerpcvtsc_clang" \ make $* # more /root/src.configs/src.conf.powerpc-clang-bootstrap.amd64-host TO_TYPE=3Dpowerpc # KERNCONF=3DGENERICvtsc-NODBG TARGET=3D${TO_TYPE} .if ${.MAKE.LEVEL} =3D=3D 0 TARGET_ARCH=3D${TO_TYPE} .export TARGET_ARCH .endif # WITH_CROSS_COMPILER=3D WITHOUT_SYSTEM_COMPILER=3D # WITH_LIBCPLUSPLUS=3D WITH_BINUTILS_BOOTSTRAP=3D WITH_ELFTOOLCHAIN_BOOTSTRAP=3D WITH_CLANG_BOOTSTRAP=3D WITH_CLANG=3D WITH_CLANG_IS_CC=3D WITH_CLANG_FULL=3D WITH_CLANG_EXTRAS=3D WITH_LLD=3D # lldb requires missing atomic 8-byte operations for powerpc (non-64) WITHOUT_LLDB=3D # WITH_BOOT=3D WITHOUT_LIB32=3D # WITHOUT_GCC_BOOTSTRAP=3D WITHOUT_GCC=3D WITHOUT_GCC_IS_CC=3D WITHOUT_GNUCXX=3D # NO_WERROR=3D # # 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=3D MALLOC_PRODUCTION=3D # WITH_REPRODUCIBLE_BUILD=3D WITH_DEBUG_FILES=3D =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-ppc@freebsd.org Thu Jun 29 09:21:43 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1470CD97C5B for ; Thu, 29 Jun 2017 09:21:43 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-15.reflexion.net [208.70.210.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 435467CC36 for ; Thu, 29 Jun 2017 09:21:41 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 4281 invoked from network); 29 Jun 2017 09:25:54 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 29 Jun 2017 09:25:54 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Thu, 29 Jun 2017 05:21:40 -0400 (EDT) Received: (qmail 22525 invoked from network); 29 Jun 2017 09:21:40 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 29 Jun 2017 09:21:40 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id D8997EC7E56; Thu, 29 Jun 2017 02:21:39 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: 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 In-Reply-To: Date: Thu, 29 Jun 2017 02:21:38 -0700 Cc: FreeBSD PowerPC ML , FreeBSD Toolchain , FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: <5B12D9A6-C9A2-4B0D-B32D-D04D7DB1E3BC@dsl-only.net> References: To: Justin Hibbits X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 09:21:43 -0000 [TARGET_ARCH=3Dpowerpc64 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: >=20 > static_assert expression is not an integral constant expression >=20 >=20 > [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.] >=20 >=20 > Context: >=20 > # uname -apKU > FreeBSD FreeBSDx64OPC 12.0-CURRENT FreeBSD 12.0-CURRENT r320458M = amd64 amd64 1200036 1200036 >=20 > buildworld for TARGET_ARCH=3Dpowerpc resulted in: >=20 > --- 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 >, = 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 = -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 >, = 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 >=20 > make[5]: stopped in /usr/src/lib/libc++experimental > .ERROR_TARGET=3D'filesystem/operations.o' > = .ERROR_META_FILE=3D'/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=3D'5' > MAKEFILE=3D'' > .MAKE.MODE=3D'meta missing-filemon=3Dyes missing-meta=3Dyes silent=3Dyes= verbose' > _ERROR_CMD=3D'c++ -target powerpc-unknown-freebsd12.0 = --sysroot=3D/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=3Dc++14 = -Wno-c++11-extensions -c = /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp -o = filesystem/operations.o;' > .CURDIR=3D'/usr/src/lib/libc++experimental' >=20 >=20 > # 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=3D/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=3Dc++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 >, = 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 = -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 >, = 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))), = ""); > ^ > 7 errors generated. > *** Error code 1 >=20 >=20 >=20 > Build configuration: >=20 >=20 > # 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 >=20 >=20 > # more = ~/sys_build_scripts.amd64-host/make_powerpcvtsc_nodebug_clang_bootstrap-am= d64-host.sh=20 > kldload -n filemon && \ > script = ~/sys_typescripts/typescript_make_powerpcvtsc_nodebug_clang_bootstrap-amd6= 4-host-$(date +%Y-%m-%d:%H:%M:%S) \ > env __MAKE_CONF=3D"/root/src.configs/make.conf" SRCCONF=3D"/dev/null" = SRC_ENV_CONF=3D"/root/src.configs/src.conf.powerpc-clang-bootstrap.amd64-h= ost" \ > WITH_META_MODE=3Dyes \ > MAKEOBJDIRPREFIX=3D"/usr/obj/powerpcvtsc_clang" \ > make $* >=20 >=20 > # more /root/src.configs/src.conf.powerpc-clang-bootstrap.amd64-host > TO_TYPE=3Dpowerpc > # > KERNCONF=3DGENERICvtsc-NODBG > TARGET=3D${TO_TYPE} > .if ${.MAKE.LEVEL} =3D=3D 0 > TARGET_ARCH=3D${TO_TYPE} > .export TARGET_ARCH > .endif > # > WITH_CROSS_COMPILER=3D > WITHOUT_SYSTEM_COMPILER=3D > # > WITH_LIBCPLUSPLUS=3D > WITH_BINUTILS_BOOTSTRAP=3D > WITH_ELFTOOLCHAIN_BOOTSTRAP=3D > WITH_CLANG_BOOTSTRAP=3D > WITH_CLANG=3D > WITH_CLANG_IS_CC=3D > WITH_CLANG_FULL=3D > WITH_CLANG_EXTRAS=3D > WITH_LLD=3D > # lldb requires missing atomic 8-byte operations for powerpc (non-64) > WITHOUT_LLDB=3D > # > WITH_BOOT=3D > WITHOUT_LIB32=3D > # > WITHOUT_GCC_BOOTSTRAP=3D > WITHOUT_GCC=3D > WITHOUT_GCC_IS_CC=3D > WITHOUT_GNUCXX=3D > # > NO_WERROR=3D > # > # 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=3D > MALLOC_PRODUCTION=3D > # > WITH_REPRODUCIBLE_BUILD=3D > WITH_DEBUG_FILES=3D The world32 part of a TARGET_ARCH=3Dpowerpc64 cross-buildworld also gets the same errors. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-ppc@freebsd.org Thu Jun 29 10:04:23 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23C7BD98A5A for ; Thu, 29 Jun 2017 10:04:23 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-15.reflexion.net [208.70.210.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA39E7E16F for ; Thu, 29 Jun 2017 10:04:22 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 26089 invoked from network); 29 Jun 2017 10:08:34 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 29 Jun 2017 10:08:34 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Thu, 29 Jun 2017 06:04:21 -0400 (EDT) Received: (qmail 1759 invoked from network); 29 Jun 2017 10:04:20 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 29 Jun 2017 10:04:20 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 37AD1EC8A8B; Thu, 29 Jun 2017 03:04:20 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: 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 In-Reply-To: <5B12D9A6-C9A2-4B0D-B32D-D04D7DB1E3BC@dsl-only.net> Date: Thu, 29 Jun 2017 03:04:19 -0700 Cc: FreeBSD Toolchain , FreeBSD Current , FreeBSD PowerPC ML Content-Transfer-Encoding: quoted-printable Message-Id: References: <5B12D9A6-C9A2-4B0D-B32D-D04D7DB1E3BC@dsl-only.net> To: Justin Hibbits X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 10:04:23 -0000 [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=3Dpowerpc64 fails similarly in its world32 > part of its build.] >=20 > On 2017-Jun-29, at 1:33 AM, Mark Millard wrote: >=20 >> Beyond static_assert failures and overflow/underflow of long long >> it also it complains in some cases about: >>=20 >> static_assert expression is not an integral constant expression >>=20 >>=20 >> [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.] >>=20 >>=20 >> Context: >>=20 >> # uname -apKU >> FreeBSD FreeBSDx64OPC 12.0-CURRENT FreeBSD 12.0-CURRENT r320458M = amd64 amd64 1200036 1200036 >>=20 >> buildworld for TARGET_ARCH=3Dpowerpc resulted in: >>=20 >> --- 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 >, = 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 = -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 >, = 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 >>=20 >> make[5]: stopped in /usr/src/lib/libc++experimental >> .ERROR_TARGET=3D'filesystem/operations.o' >> = .ERROR_META_FILE=3D'/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=3D'5' >> MAKEFILE=3D'' >> .MAKE.MODE=3D'meta missing-filemon=3Dyes missing-meta=3Dyes = silent=3Dyes verbose' >> _ERROR_CMD=3D'c++ -target powerpc-unknown-freebsd12.0 = --sysroot=3D/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=3Dc++14 = -Wno-c++11-extensions -c = /usr/src/contrib/libc++/src/experimental/filesystem/operations.cpp -o = filesystem/operations.o;' >> .CURDIR=3D'/usr/src/lib/libc++experimental' >>=20 >>=20 >> # 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=3D/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=3Dc++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 >, = 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 = -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 >, = 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))), = ""); >> ^ >> 7 errors generated. >> *** Error code 1 >>=20 >>=20 >>=20 >> Build configuration: >>=20 >>=20 >> # 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 >>=20 >>=20 >> # more = ~/sys_build_scripts.amd64-host/make_powerpcvtsc_nodebug_clang_bootstrap-am= d64-host.sh=20 >> kldload -n filemon && \ >> script = ~/sys_typescripts/typescript_make_powerpcvtsc_nodebug_clang_bootstrap-amd6= 4-host-$(date +%Y-%m-%d:%H:%M:%S) \ >> env __MAKE_CONF=3D"/root/src.configs/make.conf" SRCCONF=3D"/dev/null" = SRC_ENV_CONF=3D"/root/src.configs/src.conf.powerpc-clang-bootstrap.amd64-h= ost" \ >> WITH_META_MODE=3Dyes \ >> MAKEOBJDIRPREFIX=3D"/usr/obj/powerpcvtsc_clang" \ >> make $* >>=20 >>=20 >> # more /root/src.configs/src.conf.powerpc-clang-bootstrap.amd64-host >> TO_TYPE=3Dpowerpc >> # >> KERNCONF=3DGENERICvtsc-NODBG >> TARGET=3D${TO_TYPE} >> .if ${.MAKE.LEVEL} =3D=3D 0 >> TARGET_ARCH=3D${TO_TYPE} >> .export TARGET_ARCH >> .endif >> # >> WITH_CROSS_COMPILER=3D >> WITHOUT_SYSTEM_COMPILER=3D >> # >> WITH_LIBCPLUSPLUS=3D >> WITH_BINUTILS_BOOTSTRAP=3D >> WITH_ELFTOOLCHAIN_BOOTSTRAP=3D >> WITH_CLANG_BOOTSTRAP=3D >> WITH_CLANG=3D >> WITH_CLANG_IS_CC=3D >> WITH_CLANG_FULL=3D >> WITH_CLANG_EXTRAS=3D >> WITH_LLD=3D >> # lldb requires missing atomic 8-byte operations for powerpc (non-64) >> WITHOUT_LLDB=3D >> # >> WITH_BOOT=3D >> WITHOUT_LIB32=3D >> # >> WITHOUT_GCC_BOOTSTRAP=3D >> WITHOUT_GCC=3D >> WITHOUT_GCC_IS_CC=3D >> WITHOUT_GNUCXX=3D >> # >> NO_WERROR=3D >> # >> # 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=3D >> MALLOC_PRODUCTION=3D >> # >> WITH_REPRODUCIBLE_BUILD=3D >> WITH_DEBUG_FILES=3D >=20 >=20 > The world32 part of a TARGET_ARCH=3Dpowerpc64 cross-buildworld > also gets the same errors. Turns out the libc++ code in question looks like: _LIBCPP_CONSTEXPR_AFTER_CXX11 bool is_representable(TimeSpec const& tm) { if (tm.tv_sec >=3D 0) { return (tm.tv_sec < max_seconds) || (tm.tv_sec =3D=3D max_seconds && tm.tv_nsec <=3D max_nsec); } else if (tm.tv_sec =3D=3D (min_seconds - 1)) { return tm.tv_nsec >=3D min_nsec_timespec; } else { return (tm.tv_sec >=3D min_seconds); } } #ifndef _LIBCPP_HAS_NO_CXX14_CONSTEXPR #if defined(__LP64__) . . . #else static_assert(is_representable({max_time_t, 999999999}), ""); static_assert(is_representable({max_time_t, 1000000000}), ""); static_assert(is_representable({min_time_t, 0}), ""); #endif #endif =20 _LIBCPP_CONSTEXPR_AFTER_CXX11 bool is_representable(file_time_type const& tm) { auto secs =3D duration_cast(tm.time_since_epoch()); auto nsecs =3D duration_cast(tm.time_since_epoch() - = secs); if (nsecs.count() < 0) { secs =3D secs + seconds(1); nsecs =3D nsecs + seconds(1); } using TLim =3D numeric_limits; if (secs.count() >=3D 0) return secs.count() <=3D TLim::max(); return secs.count() >=3D TLim::min(); } #ifndef _LIBCPP_HAS_NO_CXX14_CONSTEXPR #if defined(__LP64__) . . . #else static_assert(!is_representable(file_time_type::max()), ""); static_assert(!is_representable(file_time_type::min()), ""); static_assert(is_representable(file_time_type(seconds(max_time_t))), = ""); static_assert(is_representable(file_time_type(seconds(min_time_t))), = ""); #endif #endif _LIBCPP_CONSTEXPR_AFTER_CXX11 file_time_type convert_timespec(TimeSpec const& tm) { auto adj_msec =3D = duration_cast(nanoseconds(tm.tv_nsec)); if (tm.tv_sec >=3D 0) { auto Dur =3D seconds(tm.tv_sec) + microseconds(adj_msec); return file_time_type(Dur); } else if = (duration_cast(nanoseconds(tm.tv_nsec)).count() =3D=3D 0) = { return file_time_type(seconds(tm.tv_sec)); } else { // tm.tv_sec < 0 auto adj_subsec =3D duration_cast(seconds(1) - = nanoseconds(tm.tv_nsec)); auto Dur =3D seconds(tm.tv_sec + 1) - adj_subsec; return file_time_type(Dur); } } #ifndef _LIBCPP_HAS_NO_CXX14_CONSTEXPR #if defined(__LP64__) . . . #else // FIXME add tests for 32 bit builds #endif #endif That "FIXME" likely gives a clue as to the status of of the handling for ILP32 contexts. There seems to be the expectation that IPL32 will not have 64-bit time_t as well. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-ppc@freebsd.org Thu Jun 29 10:47:27 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83CD4D998BF; Thu, 29 Jun 2017 10:47:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AF197F66D; Thu, 29 Jun 2017 10:47:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.avinity.tv (unknown [77.95.97.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 859203610B; Thu, 29 Jun 2017 12:47:24 +0200 (CEST) From: Dimitry Andric Message-Id: <55A1694D-BC40-49AE-BEF7-CEE502126E96@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_A202DD99-D88D-4954-9D60-71CF9D49724A"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: 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) Date: Thu, 29 Jun 2017 12:47:10 +0200 In-Reply-To: Cc: Justin Hibbits , FreeBSD Toolchain , FreeBSD PowerPC ML , FreeBSD Current To: Mark Millard References: <5B12D9A6-C9A2-4B0D-B32D-D04D7DB1E3BC@dsl-only.net> X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 10:47:27 -0000 --Apple-Mail=_A202DD99-D88D-4954-9D60-71CF9D49724A Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii 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 --Apple-Mail=_A202DD99-D88D-4954-9D60-71CF9D49724A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAllU2rsACgkQsF6jCi4glqNamACfRXH3Q0QNcEPOzK2H7KCmwgLz oAoAnRy1xkn/1oXK7qgTm5Lx8a6r7Tqt =+cuF -----END PGP SIGNATURE----- --Apple-Mail=_A202DD99-D88D-4954-9D60-71CF9D49724A-- From owner-freebsd-ppc@freebsd.org Thu Jun 29 17:33:12 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FEC1DA1C40 for ; Thu, 29 Jun 2017 17:33:12 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-15.reflexion.net [208.70.210.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3BEA67DCF for ; Thu, 29 Jun 2017 17:33:11 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 2828 invoked from network); 29 Jun 2017 17:34:40 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 29 Jun 2017 17:34:40 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Thu, 29 Jun 2017 13:33:10 -0400 (EDT) Received: (qmail 3134 invoked from network); 29 Jun 2017 17:33:10 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 29 Jun 2017 17:33:10 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 6D0D0EC7E56; Thu, 29 Jun 2017 10:33:09 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: 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 In-Reply-To: <55A1694D-BC40-49AE-BEF7-CEE502126E96@FreeBSD.org> Date: Thu, 29 Jun 2017 10:33:09 -0700 Cc: Justin Hibbits , FreeBSD Toolchain , FreeBSD PowerPC ML , FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: References: <5B12D9A6-C9A2-4B0D-B32D-D04D7DB1E3BC@dsl-only.net> <55A1694D-BC40-49AE-BEF7-CEE502126E96@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 17:33:12 -0000 [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: >>=20 >> [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.] >=20 > Yes, this also broke earlier on arm and mips, which is why there is = the > following in lib/Makefile: >=20 > .if ${MACHINE_CPUARCH} !=3D "arm" && ${MACHINE_CPUARCH} !=3D "mips" > _libcplusplus+=3D libc++experimental > .endif >=20 > I haven't yet found the time to address this issue. Upstream should > already be aware of it, though. >=20 > 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=3Dpowerpc = 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 =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-ppc@freebsd.org Thu Jun 29 22:33:35 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F2B9DA712E for ; Thu, 29 Jun 2017 22:33:35 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-15.reflexion.net [208.70.210.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8FE27661E for ; Thu, 29 Jun 2017 22:33:34 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 7394 invoked from network); 29 Jun 2017 22:33:27 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 29 Jun 2017 22:33:27 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Thu, 29 Jun 2017 18:33:27 -0400 (EDT) Received: (qmail 10482 invoked from network); 29 Jun 2017 22:33:27 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 29 Jun 2017 22:33:27 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 6931EEC8029; Thu, 29 Jun 2017 15:33:26 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: head -r320458 (e.g.) amd64 -> powerpc64 cross build's install32 during installworld: /usr/src/share/mk/bsd.linker.mk tried to use "head" when PATH provided no access (head is missing) Message-Id: <0E42D991-D350-4DC1-A683-CEA506167520@dsl-only.net> Date: Thu, 29 Jun 2017 15:33:25 -0700 To: Bryan Drewery , Ed Maste , FreeBSD Toolchain , FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 22:33:35 -0000 [This is a clang targetting powerpc64 context from my experimentation efforts, not the normal gcc 4.2.1 context for powerpc64.] I break out the PATH into lines below to make it easier to scan. See the later "sh: head: not found" line and the even later ls of the directory with the x86-64 program directory in use: no "head" is present to find. --- install32 --- cd /usr/src/lib; MACHINE=3Dpowerpc MACHINE_ARCH=3Dpowerpc = MAKEOBJDIRPREFIX=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerp= c64/usr/src/world32 = PATH=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/= tmp/legacy/usr/sbin = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/le= gacy/usr/bin = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/le= gacy/bin = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/us= r/sbin = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/us= r/bin = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/le= gacy/usr/sbin = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/le= gacy/usr/bin = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/le= gacy/bin = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/us= r/sbin = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/us= r/bin :/tmp/install.7ljKosWa = SYSROOT=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/s= rc/lib32 LIBDIR=3D/usr/lib32 SHLIBDIR=3D/usr/lib32 DTRACE=3D"dtrace" = make LD=3D"/usr/local/powerpc64-freebsd/bin/ld -m elf32ppc_fbsd" = OBJCOPY=3D"/usr/local/powerpc64-freebsd/bin/objcopy" = NM=3D"/usr/local/powerpc64-freebsd/bin/nm" -DCOMPAT_32BIT CC=3D"cc = -target powerpc64-unknown-freebsd12.0 = --sysroot=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr= /src/tmp -B/usr/local/powerpc64-freebsd/bin/ -DCOMPAT_32BIT = -mcpu=3Dpowerpc -m32 = -L/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib32= /usr/lib32 = --sysroot=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr= /src/lib32 -B/usr/local/powerpc64-freebsd/bin/ = -B/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib32= /usr/lib32" CXX=3D"c++ -target powerpc64-unknown-freebsd12.0 = --sysroot=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr= /src/tmp -B/usr/local/powerpc64-freebsd/bin/ -DCOMPAT_32BIT = -mcpu=3Dpowerpc -m32 = -L/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib32= /usr/lib32 = --sysroot=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr= /src/lib32 -B/usr/local/powerpc64-freebsd/bin/ = -B/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib32= /usr/lib32" CPP=3D"cpp -target powerpc64-unknown-freebsd12.0 = --sysroot=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr= /src/tmp -B/usr/local/powerpc64-freebsd/bin/ -DCOMPAT_32BIT = -mcpu=3Dpowerpc -m32 = -L/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib32= /usr/lib32 = --sysroot=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr= /src/lib32 -B/usr/local/powerpc64-freebsd/bin/ = -B/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib32= /usr/lib32" -DNO_CPU_CFLAGS MK_CTF=3Dno -DNO_LINT MK_TESTS=3Dno = MK_MAN=3Dno MK_HTML=3Dno MK_TOOLCHAIN=3Dno -DLIBRARIES_ONLY install sh: head: not found make[4]: "/usr/src/share/mk/bsd.linker.mk" line 47: Unable to determine = linker type from XLD=3D/usr/local/powerpc64-freebsd/bin/ld *** [install32] Error code 1 # ls -lT /tmp/install.7ljKosWa/ total 6151 -r-xr-xr-x 1 root wheel 12592 Jun 29 14:02:46 2017 [ -r-xr-xr-x 1 root wheel 207320 Jun 29 14:02:46 2017 awk -r-xr-xr-x 1 root wheel 8456 Jun 29 14:02:46 2017 cap_mkdb -r-xr-xr-x 1 root wheel 13272 Jun 29 14:02:46 2017 cat . . . -r-xr-xr-x 1 root wheel 57632 Jun 29 14:02:46 2017 find -r-xr-xr-x 1 root wheel 99064 Jun 29 14:02:46 2017 grep -r-xr-xr-x 1 root wheel 13360 Jun 29 14:02:46 2017 id . . . So there is no "head" to find. Below uses "find" instead to confirm the x86-64 ELF status: # file /tmp/install.7ljKosWa/find /tmp/install.7ljKosWa/find: ELF 64-bit LSB executable, x86-64, version 1 = (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for = FreeBSD 12.0 (1200036), FreeBSD-style, stripped =46rom /usr/src/share/mk/bsd.linker.mk : .if ${ld} =3D=3D "LD" || (${ld} =3D=3D "XLD" && ${XLD} !=3D ${LD}) .if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION) _ld_version!=3D ${${ld}} --version 2>/dev/null | head -n 1 || echo = none .if ${_ld_version} =3D=3D "none" .error Unable to determine linker type from ${ld}=3D${${ld}} .endif Trying the failing line interactively (no PATH like above though): # /usr/local/powerpc64-freebsd/bin/ld --version 2>/dev/null | head -n 1 = || echo none GNU ld (GNU Binutils) 2.28 So /tmp/install.7ljKosWa/ just needed a copy of head in addition to what it already had. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-ppc@freebsd.org Fri Jun 30 01:21:53 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99A68DA9E89 for ; Fri, 30 Jun 2017 01:21:53 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-15.reflexion.net [208.70.210.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D9387ABEA for ; Fri, 30 Jun 2017 01:21:52 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 5833 invoked from network); 30 Jun 2017 01:21:51 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 30 Jun 2017 01:21:51 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Thu, 29 Jun 2017 21:21:51 -0400 (EDT) Received: (qmail 24331 invoked from network); 30 Jun 2017 01:21:51 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 30 Jun 2017 01:21:51 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 8D0D8EC8AD1; Thu, 29 Jun 2017 18:21:50 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: head -r320458 (e.g.) amd64 -> powerpc64 cross build's install32 during installworld: /usr/src/share/mk/bsd.linker.mk tried to use "head" when PATH provided no access (head is missing) From: Mark Millard In-Reply-To: <0E42D991-D350-4DC1-A683-CEA506167520@dsl-only.net> Date: Thu, 29 Jun 2017 18:21:50 -0700 Cc: Bryan Drewery , FreeBSD Toolchain , FreeBSD PowerPC ML Content-Transfer-Encoding: quoted-printable Message-Id: References: <0E42D991-D350-4DC1-A683-CEA506167520@dsl-only.net> To: Ed Maste X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2017 01:21:53 -0000 [I found where the tools are listed that are copied, the list that is missing head.] On 2017-Jun-29, at 3:33 PM, Mark Millard wrote: > [This is a clang targetting powerpc64 context from my > experimentation efforts, not the normal gcc 4.2.1 context > for powerpc64.] >=20 > I break out the PATH into lines below to make it easier to scan. > See the later "sh: head: not found" line and the even later ls > of the directory with the x86-64 program directory in use: no > "head" is present to find. >=20 > --- install32 --- > cd /usr/src/lib; MACHINE=3Dpowerpc MACHINE_ARCH=3Dpowerpc = MAKEOBJDIRPREFIX=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerp= c64/usr/src/world32 > = PATH=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/= tmp/legacy/usr/sbin > = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/le= gacy/usr/bin > = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/le= gacy/bin > = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/us= r/sbin > = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/us= r/bin > = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/le= gacy/usr/sbin > = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/le= gacy/usr/bin > = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/le= gacy/bin > = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/us= r/sbin > = :/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/us= r/bin > :/tmp/install.7ljKosWa > = SYSROOT=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/s= rc/lib32 LIBDIR=3D/usr/lib32 SHLIBDIR=3D/usr/lib32 DTRACE=3D"dtrace" = make LD=3D"/usr/local/powerpc64-freebsd/bin/ld -m elf32ppc_fbsd" = OBJCOPY=3D"/usr/local/powerpc64-freebsd/bin/objcopy" = NM=3D"/usr/local/powerpc64-freebsd/bin/nm" -DCOMPAT_32BIT CC=3D"cc = -target powerpc64-unknown-freebsd12.0 = --sysroot=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr= /src/tmp -B/usr/local/powerpc64-freebsd/bin/ -DCOMPAT_32BIT = -mcpu=3Dpowerpc -m32 = -L/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib32= /usr/lib32 = --sysroot=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr= /src/lib32 -B/usr/local/powerpc64-freebsd/bin/ = -B/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib32= /usr/lib32" CXX=3D"c++ -target powerpc64-unknown-freebsd12.0 = --sysroot=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr= /src/tmp -B/usr/local/powerpc64-freebsd/bin/ -DCOMPAT_32BIT = -mcpu=3Dpowerpc -m32 -L/ > = usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib32/us= r/lib32 = --sysroot=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr= /src/lib32 -B/usr/local/powerpc64-freebsd/bin/ = -B/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib32= /usr/lib32" CPP=3D"cpp -target powerpc64-unknown-freebsd12.0 = --sysroot=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr= /src/tmp -B/usr/local/powerpc64-freebsd/bin/ -DCOMPAT_32BIT = -mcpu=3Dpowerpc -m32 = -L/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib32= /usr/lib32 = --sysroot=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr= /src/lib32 -B/usr/local/powerpc64-freebsd/bin/ = -B/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib32= /usr/lib32" -DNO_CPU_CFLAGS MK_CTF=3Dno -DNO_LINT MK_TESTS=3Dno = MK_MAN=3Dno MK_HTML=3Dno MK_TOOLCHAIN=3Dno -DLIBRARIES_ONLY install > sh: head: not found > make[4]: "/usr/src/share/mk/bsd.linker.mk" line 47: Unable to = determine linker type from XLD=3D/usr/local/powerpc64-freebsd/bin/ld > *** [install32] Error code 1 >=20 > # ls -lT /tmp/install.7ljKosWa/ > total 6151 > -r-xr-xr-x 1 root wheel 12592 Jun 29 14:02:46 2017 [ > -r-xr-xr-x 1 root wheel 207320 Jun 29 14:02:46 2017 awk > -r-xr-xr-x 1 root wheel 8456 Jun 29 14:02:46 2017 cap_mkdb > -r-xr-xr-x 1 root wheel 13272 Jun 29 14:02:46 2017 cat > . . . > -r-xr-xr-x 1 root wheel 57632 Jun 29 14:02:46 2017 find > -r-xr-xr-x 1 root wheel 99064 Jun 29 14:02:46 2017 grep > -r-xr-xr-x 1 root wheel 13360 Jun 29 14:02:46 2017 id > . . . >=20 > So there is no "head" to find. Below uses "find" instead > to confirm the x86-64 ELF status: >=20 > # file /tmp/install.7ljKosWa/find > /tmp/install.7ljKosWa/find: ELF 64-bit LSB executable, x86-64, version = 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for = FreeBSD 12.0 (1200036), FreeBSD-style, stripped >=20 >=20 >=20 > =46rom /usr/src/share/mk/bsd.linker.mk : >=20 > .if ${ld} =3D=3D "LD" || (${ld} =3D=3D "XLD" && ${XLD} !=3D ${LD}) > .if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION) > _ld_version!=3D ${${ld}} --version 2>/dev/null | head -n 1 || echo = none > .if ${_ld_version} =3D=3D "none" > .error Unable to determine linker type from ${ld}=3D${${ld}} > .endif >=20 >=20 > Trying the failing line interactively (no PATH > like above though): >=20 > # /usr/local/powerpc64-freebsd/bin/ld --version 2>/dev/null | head -n = 1 || echo none > GNU ld (GNU Binutils) 2.28 >=20 > So /tmp/install.7ljKosWa/ just needed a copy of head > in addition to what it already had. In /usr/src/Makefile.inc1 : ITOOLS=3D [ awk cap_mkdb cat chflags chmod chown cmp cp \ date echo egrep find grep id install ${_install-info} \ ln make mkdir mtree mv pwd_mkdb \ rm sed services_mkdb sh strip sysctl test true uname wc = ${_zoneinfo} \ ${LOCAL_ITOOLS} does not list "head" as a tool. But I can externally add it via LOCAL_ITOOLS use. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-ppc@freebsd.org Fri Jun 30 09:07:59 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49C53D8C811 for ; Fri, 30 Jun 2017 09:07:59 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-15.reflexion.net [208.70.210.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F339C17F6 for ; Fri, 30 Jun 2017 09:07:58 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 1560 invoked from network); 30 Jun 2017 09:12:11 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 30 Jun 2017 09:12:11 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Fri, 30 Jun 2017 05:07:56 -0400 (EDT) Received: (qmail 26453 invoked from network); 30 Jun 2017 09:07:56 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 30 Jun 2017 09:07:56 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id AD4B1EC7E56; Fri, 30 Jun 2017 02:07:55 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: head -r320482 vs. TARGET_ARCH=powerpc production style kernel: jumps to non-code and traps (but the debug kernel build works for the same world) Message-Id: <1F24D891-4D11-4623-8183-7F95D9637FB2@dsl-only.net> Date: Fri, 30 Jun 2017 02:07:55 -0700 To: FreeBSD PowerPC ML , FreeBSD Current , freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2017 09:07:59 -0000 The -r320482 kernel build is via gcc 4.2.1. Both gcc 4.2.1 and clang based worlds show the same problems. TARGET_ARCH=3Dpowerpc64 is not showing the problems. The production kernel build fails but the debug works --each built from the same /usr/src/ tree. I'll note what a normal boot does before getting to the login prompt but after "Starting nfsd." ("Updating motd:" can be mixed in the trap text: not shown below.) I use an example and note a lot about what varies and what stays the same from example boot to example boot of the production kernel. [Manually entered from camera pictures of the screen.] fatal kernel trap exception =3D 0x700 (program) (for "illegal instruction") srr0 =3D 0x70bf878 (note: this varies, for example: 0x5e37230) (note: r0 always matches srr0) (note: ctr always matches srr0) srr1 =3D 0x89032 (stays the same) lr =3D 0x5b7b94 (note: solisten_wakeup+0x4c) (stays the same) curthread =3D 0x5ab8ae0 (varies) pid =3D 920 (varies), comm =3D mountd (stays the same) Tracing command mountd pid 920 tid 100119 (varies) td 0x5ab8ae0 = (varies)(CPU 1) (stack addr range varies) 0xd250a500: at soisconnected+0x21c (at stays the same) 0xd250a540: at unp_connect2+0xf0 (at stays the same) 0xd250a560: at unp_connectat+0x658 (at stays the same) 0xd250a770: at unp_connect+0x2c (at stays the same) 0xd250a790: at uipc_connect+0xc0 (at stays the same) 0xd250a7d0: at soconnectat+0xa0 (at stays the same) 0xd250a800: at soconnect+0x2c (at stays the same) 0xd250a820: at kern_connect+0134 (at stays the same) 0xd250a870: at sys_connect+0x64 (at stays the same) 0xd250a8b0: at trap+0x638 (at stays the same) 0xd250aa50: at powerpc_interrupt+0x1a0 (at stays the same) 0xd250aa80: at user SC trap (at stays the same) by 0x419db168 (stays the same) srr1=3D0xf032 (stays the same) r1 =3D0xffffd5e0 (stays the same) cr =3D0x24440840 (stays the same) xer =3D0x20000000 (stays the same) ctr =3D0x419db160 (stays the same) 005b7b48 stwu r1,-32(r1) 005b7b4c mflr r0 005b7b50 stw r29,20(r1) 005b7b54 stw r30,24(r1) 005b7b58 stw r31,28(r1) 005b7b5c stw r0,36(r1) 005b7b60 mr r31,r1 005b7b64 bcl- 20,4*cr7+so,005b7b68 = 005b7b68 mflr r30 005b7b6c lwz r0,-36(r30) 005b7b70 add r30,r0,r30 005b7b74 mr r29,r3 005b7b78 lwz r0,232(r3) 005b7b7c cmpwi cr7,r0,0 005b7b80 beq- cr7,005b7b98 = 005b7b84 lwz r4,236(r3) 005b7b88 li r5,1 005b7b8c mtctr r0 005b7b90 bctrl lr: 005b7b94 b 005b7bb4 . . . Apparently this means that sol->sol_upcall is not pointing to code at all yet is not null. Given the variability observed, it might be uninitialized --or sol itself is junk. . . void solisten_wakeup(struct socket *sol) { =20 if (sol->sol_upcall !=3D NULL) (void )sol->sol_upcall(sol, sol->sol_upcallarg, = M_NOWAIT); else { selwakeuppri(&sol->so_rdsel, PSOCK); KNOTE_LOCKED(&sol->so_rdsel.si_note, 0); } SOLISTEN_UNLOCK(sol); wakeup_one(&sol->sol_comp); } =20 005b8548 li r10,1 005b854c b 005b8558 005b8550 stwcx. r10,0,r9 005b8554 li r10,0 005b8558 cmpwi cr7,r10,0 005b855c bne- cr7,005b8568 = 005b8560 addi r3,r28,16 005b8564 bl 004d4218 <__mtx_unlock_sleep> 005b8568 mr r3,r27 at soisconnected+0x21c: 005b856c bl 005b7b48 005b8570 b 005b89f0 . . . void soisconnected(struct socket *so) { struct socket *head; . . . restart: =20 SOCK_LOCK(so); if ((head =3D so->so_listen) !=3D NULL && __predict_false(SOLISTEN_TRYLOCK(head) =3D=3D 0)) { SOCK_UNLOCK(so); goto restart; } =20 so->so_state &=3D = ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING); so->so_state |=3D SS_ISCONNECTED; if (head !=3D NULL && (so->so_qstate =3D=3D SQ_INCOMP)) { again: if ((so->so_options & SO_ACCEPTFILTER) =3D=3D 0) { TAILQ_REMOVE(&head->sol_incomp, so, so_list); head->sol_incqlen--; TAILQ_INSERT_TAIL(&head->sol_comp, so, so_list); head->sol_qlen++; so->so_qstate =3D SQ_COMP; SOCK_UNLOCK(so); solisten_wakeup(head); /* unlocks */ . . . =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-ppc@freebsd.org Sat Jul 1 00:06:05 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEA7CD9E2C7 for ; Sat, 1 Jul 2017 00:06:05 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-15.reflexion.net [208.70.210.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8D1E837C1 for ; Sat, 1 Jul 2017 00:06:04 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 32648 invoked from network); 1 Jul 2017 00:10:13 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 1 Jul 2017 00:10:13 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Fri, 30 Jun 2017 20:05:58 -0400 (EDT) Received: (qmail 23420 invoked from network); 1 Jul 2017 00:05:58 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 1 Jul 2017 00:05:58 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 5280AEC893D; Fri, 30 Jun 2017 17:05:57 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: head -r320482 (e.g.): DNINIT_ALL and SOCK_MAXADDRLEN vs. SOCK_MAXADDRLEN+1 use in char buf[] declarations: is the usage all correct? Message-Id: <3390B896-622E-4548-B483-5772AB3ABD0C@dsl-only.net> Date: Fri, 30 Jun 2017 17:05:56 -0700 To: freebsd-hackers@freebsd.org, FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 00:06:06 -0000 While trying to track down a repeatable crash for powerpc production kernel's (but not debug ones) I ran into the following. (I'm not familiar with the material involved.) NDINIT_ALL in /usr/src/sys/kern/vfs_lookup.c records its char* namep argument in ndp->ni_dirp : /usr/src/sys/kern/uipc_usrreq.c: char buf[SOCK_MAXADDRLEN]; . . . NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF, UIO_SYSSPACE, buf, fd, cap_rights_init(&rights, = CAP_CONNECTAT), td); . . . (elsewhere:) void NDINIT_ALL(struct nameidata *ndp, u_long op, u_long flags, enum uio_seg = segflg, const char *namep, int dirfd, struct vnode *startdir, cap_rights_t = *rightsp, struct thread *td) { ndp->ni_cnd.cn_nameiop =3D op; ndp->ni_cnd.cn_flags =3D flags; ndp->ni_segflg =3D segflg; ndp->ni_dirp =3D namep; ndp->ni_dirfd =3D dirfd; ndp->ni_startdir =3D startdir; if (rightsp !=3D NULL) ndp->ni_rightsneeded =3D *rightsp; else cap_rights_init(&ndp->ni_rightsneeded); filecaps_init(&ndp->ni_filecaps); ndp->ni_cnd.cn_thread =3D td; } But the size of the buffer supplied in other calls varies from the size used for this call: /usr/src/sys/fs/nfsclient/nfs_clvfsops.c: if = (args.addrlen > SOCK_MAXADDRLEN) { /usr/src/sys/kern/uipc_syscalls.c: if (len > SOCK_MAXADDRLEN) /usr/src/sys/kern/uipc_usrreq.c: char buf[SOCK_MAXADDRLEN]; /usr/src/sys/netgraph/ng_ksocket.c: if (pathlen > = SOCK_MAXADDRLEN) { /usr/src/sys/netgraph/ng_ksocket.c: char = pathbuf[SOCK_MAXADDRLEN + 1]; /usr/src/sys/sys/socket.h:#define SOCK_MAXADDRLEN 255 = /* longest possible addresses */ Some of the other usage of SOCK_MAXADDRLEN is: if (vfs_getopt(mp->mnt_optnew, "addr", (void **)&args.addr, &args.addrlen) =3D=3D 0) { if (args.addrlen > SOCK_MAXADDRLEN) { error =3D ENAMETOOLONG; goto out; } nam =3D malloc(args.addrlen, M_SONAME, = M_WAITOK); bcopy(args.addr, nam, args.addrlen); nam->sa_len =3D args.addrlen; . . . if (len > SOCK_MAXADDRLEN) return (ENAMETOOLONG); if (len < offsetof(struct sockaddr, sa_data[0])) return (EINVAL); sa =3D malloc(len, M_SONAME, M_WAITOK); . . . if ((path =3D ng_get_string_token(s, off, &toklen, = NULL)) =3D=3D NULL) return (EINVAL); pathlen =3D strlen(path); if (pathlen > SOCK_MAXADDRLEN) { free(path, M_NETGRAPH_KSOCKET); return (E2BIG); } if (*buflen < pathoff + pathlen) { free(path, M_NETGRAPH_KSOCKET); return (ERANGE); } *off +=3D toklen; bcopy(path, sun->sun_path, pathlen); That last suggests that pathlen does not include a '\0' termination character position but that path is supposed to be '\0' terminated (in order to justify strlen(.) use) yet the later bcopy avoids the '\0' position for sun->sun_path. This makes it unclear which of the following is more appropriate vs. if each is correct for its specific usage: /usr/src/sys/kern/uipc_usrreq.c: . . . char buf[SOCK_MAXADDRLEN]; . . . NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF, UIO_SYSSPACE, buf, fd, cap_rights_init(&rights, = CAP_CONNECTAT), td); (The above buf has an odd number of bytes.) (The above code is in the execution sequence that leads to the powerpc fatal trap.) /usr/src/sys/netgraph/ng_ksocket.c: . . . case PF_LOCAL: { const int pathoff =3D OFFSETOF(struct sockaddr_un, = sun_path); const struct sockaddr_un *sun =3D (const struct = sockaddr_un *)sa; const int pathlen =3D sun->sun_len - pathoff; char pathbuf[SOCK_MAXADDRLEN + 1]; char *pathtoken; bcopy(sun->sun_path, pathbuf, pathlen); if ((pathtoken =3D ng_encode_string(pathbuf, pathlen)) = =3D=3D NULL) return (ENOMEM); slen +=3D snprintf(cbuf, cbuflen, "local/%s", = pathtoken); free(pathtoken, M_NETGRAPH_KSOCKET); if (slen >=3D cbuflen) return (ERANGE); *off +=3D sun->sun_len; return (0); } =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-ppc@freebsd.org Sat Jul 1 01:50:44 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FC4EDA11E0 for ; Sat, 1 Jul 2017 01:50:44 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-15.reflexion.net [208.70.210.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 099B11AA1 for ; Sat, 1 Jul 2017 01:50:43 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 5861 invoked from network); 1 Jul 2017 01:54:57 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 1 Jul 2017 01:54:57 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Fri, 30 Jun 2017 21:50:42 -0400 (EDT) Received: (qmail 18686 invoked from network); 1 Jul 2017 01:50:42 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 1 Jul 2017 01:50:42 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 47185EC81E6; Fri, 30 Jun 2017 18:50:41 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: head -r320482 vs. TARGET_ARCH=powerpc production style kernel: jumps to non-code and traps (involves ->sol_upcall pointing to ->so_rdsel) bugzilla 220404 From: Mark Millard In-Reply-To: <1F24D891-4D11-4623-8183-7F95D9637FB2@dsl-only.net> Date: Fri, 30 Jun 2017 18:50:40 -0700 Cc: Justin Hibbits , Nathan Whitehorn Content-Transfer-Encoding: quoted-printable Message-Id: <3C743FFC-2E40-4077-988C-8C4BFBA7556B@dsl-only.net> References: <1F24D891-4D11-4623-8183-7F95D9637FB2@dsl-only.net> To: glebius@FreeBSD.org, FreeBSD PowerPC ML , FreeBSD Current , freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 01:50:44 -0000 [It looks like the 2 anonymous structs in the union in the new "struct socket" are being abused such that the ->sol_upcall from the 2nd struct is being access when it has a value that was apparently assigned via ->so_rcv->sb_sel . Details follow, added to prior notes that I sent out. I've submitted bugzilla 220404 for this. The new detailed material is interlaced with earlier material that I'd sent out.] On 2017-Jun-30, at 2:07 AM, Mark Millard wrote: > The -r320482 kernel build is via gcc 4.2.1. > Both gcc 4.2.1 and clang based worlds show > the same problems. TARGET_ARCH=3Dpowerpc64 > is not showing the problems. >=20 > The production kernel build fails > but the debug works --each built > from the same /usr/src/ tree. >=20 > I'll note what a normal boot does > before getting to the login prompt but > after "Starting nfsd." ("Updating motd:" > can be mixed in the trap text: not shown > below.) >=20 > I use an example and note a lot about what > varies and what stays the same from example > boot to example boot of the production > kernel. >=20 > [Manually entered from camera pictures > of the screen.] >=20 > fatal kernel trap > exception =3D 0x700 (program) (for "illegal instruction") > srr0 =3D 0x70bf878 (note: this varies, for example: 0x5e37230) > (note: r0 always matches srr0) > (note: ctr always matches srr0) > srr1 =3D 0x89032 (stays the same) > lr =3D 0x5b7b94 (note: solisten_wakeup+0x4c) (stays the same) > curthread =3D 0x5ab8ae0 (varies) > pid =3D 920 (varies), comm =3D mountd (stays the same) >=20 > Tracing command mountd pid 920 tid 100119 (varies) td 0x5ab8ae0 = (varies)(CPU 1) > (stack addr > range varies) > 0xd250a500: at soisconnected+0x21c (at stays the same) > 0xd250a540: at unp_connect2+0xf0 (at stays the same) > 0xd250a560: at unp_connectat+0x658 (at stays the same) > 0xd250a770: at unp_connect+0x2c (at stays the same) > 0xd250a790: at uipc_connect+0xc0 (at stays the same) > 0xd250a7d0: at soconnectat+0xa0 (at stays the same) > 0xd250a800: at soconnect+0x2c (at stays the same) > 0xd250a820: at kern_connect+0134 (at stays the same) > 0xd250a870: at sys_connect+0x64 (at stays the same) > 0xd250a8b0: at trap+0x638 (at stays the same) > 0xd250aa50: at powerpc_interrupt+0x1a0 (at stays the same) > 0xd250aa80: at user SC trap (at stays the same) > by 0x419db168 (stays the same) > srr1=3D0xf032 (stays the same) > r1 =3D0xffffd5e0 (stays the same) > cr =3D0x24440840 (stays the same) > xer =3D0x20000000 (stays the same) > ctr =3D0x419db160 (stays the same) (these are objdump reported addresses) > 005b7b48 stwu r1,-32(r1) > 005b7b4c mflr r0 > 005b7b50 stw r29,20(r1) > 005b7b54 stw r30,24(r1) > 005b7b58 stw r31,28(r1) > 005b7b5c stw r0,36(r1) > 005b7b60 mr r31,r1 > 005b7b64 bcl- 20,4*cr7+so,005b7b68 = > 005b7b68 mflr r30 > 005b7b6c lwz r0,-36(r30) > 005b7b70 add r30,r0,r30 > 005b7b74 mr r29,r3 > 005b7b78 lwz r0,232(r3) > 005b7b7c cmpwi cr7,r0,0 > 005b7b80 beq- cr7,005b7b98 = > 005b7b84 lwz r4,236(r3) > 005b7b88 li r5,1 > 005b7b8c mtctr r0 > 005b7b90 bctrl > lr: > 005b7b94 b 005b7bb4 = > . . . >=20 > Apparently this means that sol->sol_upcall is not > pointing to code at all yet is not null. Given the > variability observed, it might be uninitialized > --or sol itself is junk. . . Note: r3 reported as: 0x70bf860 void solisten_wakeup(struct socket *sol) { if (sol->sol_upcall !=3D NULL) (void )sol->sol_upcall(sol, sol->sol_upcallarg, = M_NOWAIT); else { selwakeuppri(&sol->so_rdsel, PSOCK); KNOTE_LOCKED(&sol->so_rdsel.si_note, 0); } SOLISTEN_UNLOCK(sol); wakeup_one(&sol->sol_comp); } (kgdb) print/x &((struct socket*)0x70bf860)->sol_upcall $3 =3D 0x70bf948 (kgdb) print/x ((struct socket*)0x70bf860)->sol_upcall $2 =3D 0x70bf878 (kgdb) print/x &((struct socket*)0x70bf860)->so_rdsel $7 =3D 0x70bf878 (kgdb) print/x &((struct socket*)0x70bf860)->so_rdsel.si_tdlist $8 =3D 0x70bf878 (kgdb) print/x &((struct = socket*)0x70bf860)->so_rdsel.si_tdlist.tqh_first $9 =3D 0x70bf878 But comparing to the first anonymous struct in the union in the new "struct socket": (kgdb) print/x &((struct socket*)0x70bf860)->sol_upcall $15 =3D 0x70bf948 (kgdb) print/x &((struct socket*)0x70bf860)->so_rcv->sb_sel $22 =3D 0x70bf948 ->so_rcv is a struct sockbuf and ->so_rcv->sb_sel is a struct slinfo* . So pointing back to ->so_rdsel might well make sense. The rest is just supporting notes from things that I looked at before isolating the above relationship. (these are kgdb reported addresses, not vmcore.5 file offsets) 0x70bf860: 0x00c4a0b4 0x01430000 0x00000000 = 0x00000000 . . . 0x70bf940: 0x00000000 0x00000000 0x070bf878 = 0x00000000 but: 0x70bf870: 0x05ab8ae0 0x00000002 0x07271f80 = 0x07271f84 (kgdb) print/x *((struct socket*)0x70bf860) =20 $4 =3D {so_lock =3D {lock_object =3D {lo_name =3D 0xc4a0b4, lo_flags =3D = 0x1430000, lo_data =3D 0x0, lo_witness =3D 0x0}, mtx_lock =3D = 0x5ab8ae0}, so_count =3D 0x2, so_rdsel =3D {si_tdlist =3D {tqh_first =3D = 0x7271f80,=20 tqh_last =3D 0x7271f84}, si_note =3D {kl_list =3D {slh_first =3D = 0x0}, kl_lock =3D 0x5b6e84, kl_unlock =3D 0x5b6c64, kl_assert_locked =3D = 0x5b65d4, kl_assert_unlocked =3D 0x5b65f0, kl_lockarg =3D 0x70bf860,=20 kl_autodestroy =3D 0x0}, si_mtx =3D 0x5ab01f0}, so_wrsel =3D = {si_tdlist =3D {tqh_first =3D 0x0, tqh_last =3D 0x0}, si_note =3D = {kl_list =3D {slh_first =3D 0x0}, kl_lock =3D 0x5b6d64, kl_unlock =3D = 0x5b6b64,=20 kl_assert_locked =3D 0x5b660c, kl_assert_unlocked =3D 0x5b6628, = kl_lockarg =3D 0x70bf860, kl_autodestroy =3D 0x0}, si_mtx =3D 0x0}, = so_type =3D 0x1, so_options =3D 0x2, so_linger =3D 0x0, so_state =3D = 0x0,=20 so_pcb =3D 0x70b08a0, so_vnet =3D 0x0, so_proto =3D 0xd03060, so_timeo = =3D 0x0, so_error =3D 0x0, so_sigio =3D 0x0, so_cred =3D 0x5b2e600, = so_label =3D 0x0, so_gencnt =3D 0x1285, so_emuldata =3D 0x0, osd =3D { osd_nslots =3D 0x0, osd_slots =3D 0x0, osd_next =3D {le_next =3D = 0x0, le_prev =3D 0x0}}, so_fibnum =3D 0x0, so_user_cookie =3D 0x0, = so_ts_clock =3D 0x0, so_max_pacing_rate =3D 0x0, {{so_rcv =3D {sb_mtx =3D = { lock_object =3D {lo_name =3D 0x0, lo_flags =3D 0x70bf920, = lo_data =3D 0x5d17860, lo_witness =3D 0x5d17a60}, mtx_lock =3D 0x1}, = sb_sx =3D {lock_object =3D {lo_name =3D 0x0, lo_flags =3D 0x80, lo_data = =3D 0x0,=20 lo_witness =3D 0x0}, sx_lock =3D 0x0}, sb_sel =3D 0x70bf878, = sb_state =3D 0x0, sb_mb =3D 0x1, sb_mbtail =3D 0x800, sb_lastrecord =3D = 0x2000, sb_sndptr =3D 0x2000, sb_fnrdy =3D 0x0, sb_sndptroff =3D 0x0,=20 sb_acc =3D 0x0, sb_ccc =3D 0x0, sb_hiwat =3D 0x0, sb_mbcnt =3D = 0x0, sb_mcnt =3D 0x0, sb_ccnt =3D 0x0, sb_mbmax =3D 0x0, sb_ctl =3D 0x0, = sb_lowat =3D 0x1, sb_timeo =3D 0x0, sb_flags =3D 0x0, sb_upcall =3D 0x0,=20= sb_upcallarg =3D 0x0, sb_aiojobq =3D {tqh_first =3D 0x0, = tqh_last =3D 0x70bf9a4}, sb_aiotask =3D {ta_link =3D {stqe_next =3D = 0x0}, ta_pending =3D 0x0, ta_priority =3D 0x0, ta_func =3D 0x58eeb4,=20 ta_context =3D 0x70bf860}}, so_snd =3D {sb_mtx =3D = {lock_object =3D {lo_name =3D 0xc588cc, lo_flags =3D 0x1020000, lo_data = =3D 0x0, lo_witness =3D 0x0}, mtx_lock =3D 0x6}, sb_sx =3D {lock_object = =3D { lo_name =3D 0xc58efc, lo_flags =3D 0x2320000, lo_data =3D = 0x0, lo_witness =3D 0x0}, sx_lock =3D 0x6}, sb_sel =3D 0x70bf8a0, = sb_state =3D 0x0, sb_mb =3D 0x0, sb_mbtail =3D 0x0, sb_lastrecord =3D = 0x0,=20 sb_sndptr =3D 0x0, sb_fnrdy =3D 0x0, sb_sndptroff =3D 0x0, = sb_acc =3D 0x0, sb_ccc =3D 0x0, sb_hiwat =3D 0x0, sb_mbcnt =3D 0x0, = sb_mcnt =3D 0x0, sb_ccnt =3D 0x0, sb_mbmax =3D 0x0, sb_ctl =3D 0x0, = sb_lowat =3D 0x800,=20 sb_timeo =3D 0x0, sb_flags =3D 0x0, sb_upcall =3D 0x0, = sb_upcallarg =3D 0x0, sb_aiojobq =3D {tqh_first =3D 0x0, tqh_last =3D = 0x70bfa44}, sb_aiotask =3D {ta_link =3D {stqe_next =3D 0x0}, ta_pending = =3D 0x0,=20 ta_priority =3D 0x0, ta_func =3D 0x58ee80, ta_context =3D = 0x70bf860}}, so_list =3D {tqe_next =3D 0x0, tqe_prev =3D 0x0}, so_listen = =3D 0x0, so_qstate =3D 0x0, so_peerlabel =3D 0x0, so_oobmark =3D 0x0}, { sol_incomp =3D {tqh_first =3D 0x0, tqh_last =3D 0x70bf920}, = sol_comp =3D {tqh_first =3D 0x5d17860, tqh_last =3D 0x5d17a60}, sol_qlen = =3D 0x1, sol_incqlen =3D 0x0, sol_qlimit =3D 0x80, sol_accept_filter =3D = 0x0,=20 sol_accept_filter_arg =3D 0x0, sol_accept_filter_str =3D 0x0, = sol_upcall =3D 0x70bf878, sol_upcallarg =3D 0x0, sol_sbrcv_lowat =3D = 0x1, sol_sbsnd_lowat =3D 0x800, sol_sbrcv_hiwat =3D 0x2000,=20 sol_sbsnd_hiwat =3D 0x2000, sol_sbrcv_flags =3D 0x0, = sol_sbsnd_flags =3D 0x0, sol_sbrcv_timeo =3D 0x0, sol_sbsnd_timeo =3D = 0x0}}} For lo_name in sb_sx's lock_object: (kgdb) x/64c 0xc58ef0 0xc58ef0 <.rodata.str1.4+376864>: 116 't' 109 'm' 99 'c' 111 'o' = 112 'p' 121 'y' 105 'i' 110 'n' 0xc58ef8 <.rodata.str1.4+376872>: 0 '\0' 0 '\0' 0 '\0' 0 '\0' = 115 's' 111 'o' 95 '_' 115 's' 0xc58f00 <.rodata.str1.4+376880>: 110 'n' 100 'd' 95 '_' 115 's' = 120 'x' 0 '\0' 0 '\0' 0 '\0' which looks coherent to me: so_snd_sx For ta_func in sb_aiotask: (kgdb) x/64i 0x58ee80 0x58ee80 : stwu r1,-32(r1) . . . Looks coherent to me. But sol_upcall does not. >=20 >=20 > 005b8548 li r10,1 > 005b854c b 005b8558 > 005b8550 stwcx. r10,0,r9 > 005b8554 li r10,0 > 005b8558 cmpwi cr7,r10,0 > 005b855c bne- cr7,005b8568 = > 005b8560 addi r3,r28,16 > 005b8564 bl 004d4218 <__mtx_unlock_sleep> > 005b8568 mr r3,r27 > at soisconnected+0x21c: > 005b856c bl 005b7b48 > 005b8570 b 005b89f0 > . . . >=20 > void > soisconnected(struct socket *so) > { > struct socket *head; > . . . > restart: =20 > SOCK_LOCK(so); > if ((head =3D so->so_listen) !=3D NULL && > __predict_false(SOLISTEN_TRYLOCK(head) =3D=3D 0)) { > SOCK_UNLOCK(so); > goto restart; > } =20 > so->so_state &=3D = ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING); > so->so_state |=3D SS_ISCONNECTED; > if (head !=3D NULL && (so->so_qstate =3D=3D SQ_INCOMP)) { > again: > if ((so->so_options & SO_ACCEPTFILTER) =3D=3D 0) { > TAILQ_REMOVE(&head->sol_incomp, so, so_list); > head->sol_incqlen--; > TAILQ_INSERT_TAIL(&head->sol_comp, so, = so_list); > head->sol_qlen++; > so->so_qstate =3D SQ_COMP; > SOCK_UNLOCK(so); > solisten_wakeup(head); /* unlocks */ > . . . Exception and its struct trapframe: (these are vmcore file offsets: subtract 0x1000 to get address) [ lr#0 ]: inside dbtrap 00c83f40 d2 50 a4 e0 00 10 0c 54 07 0b f8 78 d2 50 a4 e0 = |.P.....T...x.P..| 00c83f50 05 ab 8a e0 07 0b f8 60 00 00 00 00 00 00 00 01 = |.......`........| [ r3 ] 00c83f60 00 00 00 00 00 00 00 01 00 00 00 00 05 d1 78 70 = |..............xp| 00c83f70 00 00 00 01 05 ab 8a e0 00 00 00 00 00 00 00 00 = |................| 00c83f80 01 81 00 00 01 82 00 00 00 00 00 00 01 82 00 00 = |................| 00c83f90 01 82 00 00 00 03 8d 6c 00 03 8d 6c 00 00 00 00 = |.......l...l....| 00c83fa0 ff ff d7 58 00 00 00 00 00 d1 1a 84 00 d1 1a 84 = |...X............| 00c83fb0 d2 50 a5 1c 07 0b f8 60 05 d1 78 60 07 0b f8 60 = |.P.....`..x`...`| [ r28 ] 00c83fc0 00 d2 aa a0 d2 50 a4 e0 00 5b 7b 94 20 00 f0 44 = |.....P...[{. ..D| [ lr#1 ]: solisten_wakeup+0x4c 00c83fd0 00 00 00 00 07 0b f8 78 07 0b f8 78 00 08 90 32 = |.......x...x...2| [ srr0 ] [exception] 00c83fe0 00 00 07 00 00 00 00 00 00 00 00 00 01 c4 5f 00 = |.............._.| 00c83ff0 00 00 00 00 00 10 01 40 00 00 00 00 00 00 00 00 = |.......@........| solisten_wakeup+0x4c's related stack frame: 0b4004e0 d2 50 a5 00 00 50 8d f8 00 d2 b0 60 00 00 00 04 = |.P...P.....`....| 0b4004f0 05 d1 7a 78 05 d1 79 30 00 d2 aa a0 d2 50 a5 00 = |..zx..y0.....P..| 0xd250a500: at soisconnected+0x21c (at stays the same) 0b400500 d2 50 a5 40 00 5b 85 70 00 d2 aa a0 d2 50 a5 10 = |.P.@.[.p.....P..| 0b400510 d2 50 a5 60 00 5b d0 d8 00 d2 ab 90 00 00 00 04 = |.P.`.[..........| 0b400520 05 d1 78 60 05 ab 8a e0 07 25 94 80 05 d1 7a 78 = |..x`.....%....zx| 0b400530 07 0b 7a 10 05 d1 78 60 00 d2 ab 90 d2 50 a5 40 = |..z...x`.....P.@| 0xd250a540: at unp_connect2+0xf0 (at stays the same) 0b400540 d2 50 a5 60 00 5c 38 34 07 25 94 80 05 d1 7a 78 = |.P.`.\84.%....zx| 0b400550 07 0b 7a 10 07 0b 79 58 00 d2 ab 90 d2 50 a5 60 = |..z...yX.....P.`| "so" first then "so2" second, with so2 failing: 0x005c3824 : mr r3,r8 0x005c3828 : bl 0x5b8350 0x005c382c : mr r3,r29 0x005c3830 : bl 0x5b8350 0x005c3834 : li r3,0 static int unp_connect2(struct socket *so, struct socket *so2, int req) . . . case SOCK_STREAM: case SOCK_SEQPACKET: unp2->unp_conn =3D unp; if (req =3D=3D PRU_CONNECT && ((unp->unp_flags | unp2->unp_flags) & UNP_CONNWAIT)) soisconnecting(so); else soisconnected(so); soisconnected(so2); break; . . . 0xd250a560: at unp_connectat+0x658 (at stays the same) 0b400560 d2 50 a7 70 00 5c 3e c4 05 ab 8a e0 00 fd c1 c0 = |.P.p.\>.........| 0b400570 d2 50 a6 3d 00 00 00 01 02 00 01 00 00 00 04 00 = |.P.=3D............| 0b400580 04 00 00 00 00 00 00 00 00 00 00 00 05 a3 7c 60 = |..............|`| 0b400590 00 00 00 00 ff ff ff 9c 00 00 00 00 00 fd c1 c0 = |................| 0b4005a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 = |................| 0b4005b0 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 = |................| 0b4005c0 07 25 94 80 05 a3 72 40 00 00 00 01 05 b2 10 15 = |.%....r@........| 0b4005d0 00 00 00 00 00 8c 05 bc 00 00 00 00 44 eb 41 81 = |............D.A.| 0b4005e0 00 00 00 00 00 00 c1 44 05 ab 8a e0 05 b2 e6 00 = |.......D........| 0b4005f0 00 20 00 00 05 b2 10 00 05 b2 10 09 00 00 00 0c |. = ..............| 0b400600 00 00 00 00 d2 50 a6 00 00 d3 23 bc 00 ce eb 40 = |.....P....#....@| 0b400610 07 25 94 80 d2 50 a6 38 05 b2 e6 00 05 ab 8a e0 = |.%...P.8........| 0b400620 02 00 01 00 00 00 04 00 04 00 00 00 00 00 00 00 = |................| 0b400630 05 c9 91 ec 00 00 00 04 07 0b 79 58 d2 2f 76 61 = |..........yX./va| 0b400640 72 2f 72 75 6e 2f 72 70 63 62 69 6e 64 2e 73 6f = |r/run/rpcbind.so| 0b400650 63 6b 00 70 00 00 00 05 00 00 00 00 00 00 00 10 = |ck.p............| 0b400660 05 d8 c4 80 d0 21 56 d4 00 d3 23 bc 00 00 00 04 = |.....!V...#.....| 0b400670 d2 50 a6 a0 40 00 f0 34 00 d1 1a 84 00 f5 0d 00 = |.P..@..4........| 0b400680 00 f5 0d 00 00 d1 1a 84 05 c9 91 ec 00 00 00 08 = |................| 0b400690 41 99 00 00 05 c2 49 d8 41 98 80 00 41 98 c0 00 = |A.....I.A...A...| 0b4006a0 00 00 00 07 00 00 00 05 d0 21 57 c8 41 99 00 00 = |.........!W.A...| 0b4006b0 05 c9 91 ec 00 fd c1 c0 00 d3 36 8c d2 50 a6 c0 = |..........6..P..| 0b4006c0 d2 50 a6 e0 00 8c 74 c0 05 c9 91 38 00 00 00 04 = |.P....t....8....| 0b4006d0 d2 50 a6 f0 00 fd c1 c0 d2 50 a6 e0 d2 50 a6 e0 = |.P.......P...P..| 0b4006e0 d2 50 a7 10 00 8f a0 94 d2 50 a6 f0 d2 50 a6 f0 = |.P.......P...P..| 0b4006f0 d2 50 a7 10 00 00 00 00 00 00 01 21 00 00 00 41 = |.P.........!...A| 0b400700 00 00 00 06 05 be e4 c0 00 d2 ab 64 d2 50 a7 10 = |...........d.P..| 0b400710 d2 50 a7 80 00 48 f2 70 00 d3 11 94 d2 50 a7 20 = |.P...H.p.....P. | 0b400720 d2 50 a7 40 00 87 1c 04 02 00 07 ff ff ff ff ff = |.P.@............| 0b400730 04 00 00 00 00 1f ff ff 00 d3 10 54 68 a4 aa 22 = |...........Th.."| 0b400740 d2 50 a7 60 00 87 1c 40 00 00 00 00 05 ab 8a e0 = |.P.`...@........| 0b400750 05 ab 8a e0 ff ff ff 9c 05 ab 8a e0 05 ab 8a e0 = |................| 0b400760 05 b1 54 20 05 d1 7a 78 00 d2 ab 90 d2 50 a7 70 |..T = ..zx.....P.p| The unp_connectat context is more complicated so I stop quoting code here. 0xd250a770: at unp_connect+0x2c (at stays the same) 0b400770 d2 50 a7 90 00 5c 41 c8 00 d2 ab 64 d2 50 a7 80 = |.P...\A....d.P..| 0b400780 d2 50 a7 e0 00 48 f5 e0 d2 50 a7 90 00 00 00 00 = |.P...H...P......| 0xd250a790: at uipc_connect+0xc0 (at stays the same) 0b400790 d2 50 a7 d0 00 5c 7b cc 00 00 00 06 05 be e4 c0 = |.P...\{.........| 0b4007a0 d2 50 a8 10 00 86 32 e8 20 00 f0 38 00 00 00 01 |.P....2. = ..8....| 0b4007b0 00 03 8d 6c 00 00 00 00 ff ff d7 58 05 b1 54 20 = |...l.......X..T | 0b4007c0 ff ff ff 9c 05 d1 7a 78 00 d2 ab 64 d2 50 a7 d0 = |......zx...d.P..| 0xd250a7d0: at soconnectat+0xa0 (at stays the same) 0b4007d0 d2 50 a8 00 00 5b 61 68 00 d2 ab 64 d2 50 a7 e0 = |.P...[ah...d.P..| 0b4007e0 d2 50 a8 20 00 5b ff 64 05 b1 54 20 05 ab 8a e0 |.P. .[.d..T = ....| 0b4007f0 00 00 00 00 05 d1 7a 78 00 d2 ab 64 d2 50 a8 00 = |......zx...d.P..| 0xd250a800: at soconnect+0x2c (at stays the same) 0b400800 d2 50 a8 20 00 5b 61 f4 05 b1 54 20 05 ab 8a e0 |.P. .[a...T = ....| 0b400810 00 00 00 25 05 d1 7a 78 d2 50 a8 20 d2 50 a8 20 |...%..zx.P. = .P. | 0xd250a820: at kern_connect+0134 (at stays the same) 0b400820 d2 50 a8 70 00 5c 19 14 ff ff d7 68 00 00 00 16 = |.P.p.\.....h....| 0b400830 00 00 00 17 05 b1 54 20 02 00 00 00 80 00 00 00 |......T = ........| 0b400840 04 00 00 00 00 00 00 00 41 98 c0 00 05 be e4 c0 = |........A.......| 0b400850 05 ab 8a e0 00 00 00 00 d2 50 aa 88 05 ab 8a e0 = |.........P......| 0b400860 00 00 00 00 05 ab 8d 78 00 d2 ab 64 d2 50 a8 70 = |.......x...d.P.p| 0xd250a870: at sys_connect+0x64 (at stays the same) 0b400870 d2 50 a8 b0 00 5c 1c 58 d2 50 aa 88 00 00 04 00 = |.P...\.X.P......| 0b400880 00 00 00 01 d2 50 aa 88 00 00 00 80 05 b1 54 20 = |.....P........T | 0b400890 d2 50 a8 b0 00 8f c3 b0 d2 50 aa 88 00 00 00 00 = |.P.......P......| 0b4008a0 05 ab 8d 70 05 d9 5a b0 00 d3 37 e8 d2 50 a8 b0 = |...p..Z...7..P..| 0xd250a8b0: at trap+0x638 (at stays the same) 0b4008b0 d2 50 aa 50 00 8f cc 3c 5a 2e a6 14 b1 ae c2 60 = |.P.P...