From owner-freebsd-toolchain@freebsd.org Sun Apr 30 22:47:09 2017 Return-Path: Delivered-To: freebsd-toolchain@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 8E928CA20B0 for ; Sun, 30 Apr 2017 22:47:09 +0000 (UTC) (envelope-from tech-lists@zyxst.net) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 624281DA3 for ; Sun, 30 Apr 2017 22:47:08 +0000 (UTC) (envelope-from tech-lists@zyxst.net) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C7CBF2068B for ; Sun, 30 Apr 2017 18:47:07 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Sun, 30 Apr 2017 18:47:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zyxst.net; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=Q1pWm6SeqXAzBCnbtzaTBWWKZWJZ0PnqDRGIyOEtD hk=; b=c89zHLTDAb7UiGG3YM/Y7VnFRZn14avwI51846LyYqDhcAnMxh7mHbEYl NZLOxtgb2t+00TOk3LesFoF28wYOJgbZnG4fMSWryEJnM7Gan9BfxGeqmLK/BOak hC3c/Ij5VsB+fwou08SJb1iuot2l5qeLsr96GMrKOnGlFHE8bYohZMDy9/wZUGVA Vaa9ulagmllgCVgUYMGIzdctHv9L9F9+ucxKZYAc3ZgIEtGPU7s3KthLkBCjaQTf mXCK8JUAe80b/3QsXESpg4vUx7WzN5PWVAdkhmRzOvYHU9B1Tdy7APQeOhQLKaHJ Y1lza6JOIRLTtF1ZMJM4sPAghQWjQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=Q1pWm6SeqXAzBCnbtz aTBWWKZWJZ0PnqDRGIyOEtDhk=; b=UP9Pf9UNgEcD0xeWipDkkS5VPWTMJ3qEJl r/mI8FC/jYVUi2aMlbvjzV9i7t3DidWjKK4/wBbKVXAN5AmqggarlRuwbDou2q++ 3U+4O9Aa6mGBCG55p+kIHeDSr0/9hc6VnM21XQlH+eMs1ip8+hWgqdanWh1hd+MB y5tUKKPvAIl+8nwaastJhf3NxPRHBM2CdtAqxNg5t3XUzTlLu2mKYzc5C5OXRCpp 7oeqpA1fryqs8mrGRKbDcguLD/nxpz/NyMuJRCfDRZ/47JGkjtjRCIB6vKPLXz9i Z/nhkSABPtWy/aoXCXM7QKF+pLMT5V3RM5vZrtDlS9fSlBWnMULg== X-ME-Sender: X-Sasl-enc: wWsG+lmIHz91NcvGw1drJzHwYs2BwTwDGCFaQR0JfKBn 1493592427 Received: from [192.168.1.230] (parsley.growveg.org [82.70.91.97]) by mail.messagingengine.com (Postfix) with ESMTPA id 594E124033 for ; Sun, 30 Apr 2017 18:47:07 -0400 (EDT) To: freebsd-toolchain@freebsd.org From: tech-lists Subject: clang/lld 4.0.0 arm64 link failure in sys/boot/efi/boot1 on arm64 Message-ID: Date: Sun, 30 Apr 2017 23:47:05 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 22:47:09 -0000 hi toolchain@, I'm trying to buildworld on a raspberrypi3 HardenedBSD-12 context. FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0) Target: aarch64-unknown-freebsd12.0 Thread model: posix InstalledDir: /usr/bin LLVM (http://llvm.org/): LLVM version 4.0.0 Optimized build. Default target: aarch64-unknown-freebsd12.0 Host CPU: (unknown) It's failing in sys/boot/efi/boot1 with this sort of error: /ldscript.arm64 -Wl,-Bsymbolic -shared -nostdlib -Wl,-z,relro -Wl,-z,now -o boot1.sym.full boot1.o self_reloc.o start.o ufs_module.o -lstand /usr/bin/ld: error: /hd0/src/lib/libstand/printf.c:(.rodata+0x0): can't create dynamic relocation R_AARCH64_ABS64 against local symbol in readonly segment defined in /usr/lib/libstand.a(printf.o) /usr/bin/ld: error: /hd0/src/lib/libstand/printf.c:(.rodata+0x8): can't create dynamic relocation R_AARCH64_ABS64 against local symbol in readonly segment defined in /usr/lib/libstand.a(printf.o) I've refreshed to very latest sources but get the same error. Full output is here: http://www.zyxst.net/~bofh/rpi3/2017-04-29.buildworldfail.hbsd12-aarch64.txt I note that a very similar error involving a different efi directory was reported back in January: http://freebsd.1045724.x6.nabble.com/clang-lld-4-0-0-arm64-link-failure-in-sys-boot-efi-loader-td6161866.html ...but no resolution/fix. Is there anything I can do? many thanks, -- J. From owner-freebsd-toolchain@freebsd.org Sun Apr 30 23:38:35 2017 Return-Path: Delivered-To: freebsd-toolchain@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 8A874D57382 for ; Sun, 30 Apr 2017 23:38:35 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-51.reflexion.net [208.70.210.51]) (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 3F53A171B for ; Sun, 30 Apr 2017 23:38:34 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 27465 invoked from network); 30 Apr 2017 23:38:33 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 30 Apr 2017 23:38:33 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Sun, 30 Apr 2017 19:38:33 -0400 (EDT) Received: (qmail 12479 invoked from network); 30 Apr 2017 23:38:33 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 30 Apr 2017 23:38:33 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 60EB7EC7D48; Sun, 30 Apr 2017 16:38:32 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: clang/lld 4.0.0 arm64 link failure in sys/boot/efi/boot1 on arm64 From: Mark Millard In-Reply-To: Date: Sun, 30 Apr 2017 16:38:31 -0700 Cc: freebsd-toolchain@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3E6F5B1D-CA52-474B-AAB5-F90A51F4292E@dsl-only.net> References: To: tech-lists X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 23:38:35 -0000 On 2017-Apr-30, at 3:47 PM, tech-lists wrote: > hi toolchain@, >=20 > I'm trying to buildworld on a raspberrypi3 HardenedBSD-12 context. >=20 > FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on > LLVM 4.0.0) > Target: aarch64-unknown-freebsd12.0 > Thread model: posix > InstalledDir: /usr/bin >=20 > LLVM (http://llvm.org/): > LLVM version 4.0.0 > Optimized build. > Default target: aarch64-unknown-freebsd12.0 > Host CPU: (unknown) >=20 > It's failing in sys/boot/efi/boot1 with this sort of error: >=20 > /ldscript.arm64 -Wl,-Bsymbolic -shared -nostdlib -Wl,-z,relro = -Wl,-z,now > -o boot1.sym.full boot1.o self_reloc.o start.o ufs_module.o -lstand > /usr/bin/ld: error: /hd0/src/lib/libstand/printf.c:(.rodata+0x0): = can't > create dynamic relocation R_AARCH64_ABS64 against local symbol in > readonly segment defined in /usr/lib/libstand.a(printf.o) > /usr/bin/ld: error: /hd0/src/lib/libstand/printf.c:(.rodata+0x8): = can't > create dynamic relocation R_AARCH64_ABS64 against local symbol in > readonly segment defined in /usr/lib/libstand.a(printf.o) >=20 > I've refreshed to very latest sources but get the same error. Full > output is here: >=20 > = http://www.zyxst.net/~bofh/rpi3/2017-04-29.buildworldfail.hbsd12-aarch64.t= xt Your toolchain configuration is using: -Wl,-z,relro (Its use is shown in 2017-04-29.buildworldfail.hbsd12-aarch64.txt .) See later below for more notes about that. But I'll also note that 2017-04-29.buildworldfail.hbsd12-aarch64.txt shows: cc: error: unable to execute command: Segmentation fault (core dumped) cc: error: linker command failed due to signal (use -v to see = invocation) *** Error code 254 not just what you report above. > I note that a very similar error involving a different efi directory = was > reported back in January: >=20 > = http://freebsd.1045724.x6.nabble.com/clang-lld-4-0-0-arm64-link-failure-in= -sys-boot-efi-loader-td6161866.html This old issue was caused (at least in part) by use of a toolchain configured to use: -Wl,-z,relro . relro puts more stuff in read-only areas, such as .rodata . Being in such areas limits what can be done and overall the tool chain may not be set up fully for respecting/handling that. > ...but no resolution/fix. Is there anything I can do? Use of -Wl,-z,relro is experimental at this point as I understand, in part because of such potential issues. Avoiding -Wl,-z,relro likely is necessary but may not be sufficient for your builds to complete. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Wed May 3 14:27:52 2017 Return-Path: Delivered-To: freebsd-toolchain@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 5E6F4D5A16F for ; Wed, 3 May 2017 14:27:52 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-62.reflexion.net [208.70.210.62]) (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 1F37C95F for ; Wed, 3 May 2017 14:27:51 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 6626 invoked from network); 3 May 2017 14:27:50 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 3 May 2017 14:27:50 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Wed, 03 May 2017 10:27:50 -0400 (EDT) Received: (qmail 29847 invoked from network); 3 May 2017 14:27:50 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 3 May 2017 14:27:50 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 6E600EC8FD9; Wed, 3 May 2017 07:27:49 -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: FYI: head -r317729 for powerpc (via clang) gets "clang frontend command failed due to signal" Message-Id: Date: Wed, 3 May 2017 07:27:48 -0700 To: FreeBSD Toolchain , FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 May 2017 14:27:52 -0000 I've made a llvm bugzilla submittal for the following: 32908 Attempting a buildworld buildkernel for TARGET_ARCH=3Dpowerpc for head -r317729 got. . . --- all_subdir_mpt --- Building = /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/m= odules/usr/src/sys/modules/mpt/mpt_cam.o --- mpt_cam.o --- cc: error: unable to execute command: Segmentation fault (core dumped) --- all_subdir_mqueue --- =3D=3D=3D> mqueue (all) --- all_subdir_mpt --- cc: error: clang frontend command failed due to signal (use -v to see = invocation) FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on = LLVM 4.0.0) Target: powerpc-unknown-freebsd12.0 Thread model: posix InstalledDir: = /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/usr/bin cc: note: diagnostic msg: PLEASE submit a bug report to = https://bugs.freebsd.org/submit/ and include the crash backtrace, = preprocessed source, and associated run script. --- all_subdir_mpt --- cc: note: diagnostic msg:=20 ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: cc: note: diagnostic msg: /tmp/mpt_cam-56fad4.c cc: note: diagnostic msg: /tmp/mpt_cam-56fad4.sh cc: note: diagnostic msg:=20 ******************** *** [mpt_cam.o] Error code 254 make[4]: stopped in /usr/src/sys/modules/mpt .ERROR_TARGET=3D'mpt_cam.o' = .ERROR_META_FILE=3D'/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys= /GENERICvtsc-NODBG/modules/usr/src/sys/modules/mpt/mpt_cam.o.meta' # ls -lTt /tmp/mpt* -rw-r--r-- 1 root wheel 4894 May 3 06:58:09 2017 = /tmp/mpt_cam-56fad4.sh -rw-r--r-- 1 root wheel 1855254 May 3 06:58:09 2017 = /tmp/mpt_cam-56fad4.c # more = /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/m= odules/usr/src/sys/modules/mpt/mpt_cam.o.meta # Meta data file = /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/m= odules/usr/src/sys/modules/mpt/mpt_cam.o.meta CMD cc -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 -fno-strict-aliasing -D_KERNEL -DKLD_MODULE -nostdinc = -DHAVE_KERNEL_OPTION_HEADERS -include = /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/o= pt_global.h -I. -I/usr/src/sys -fno-common -g -fno-omit-frame-pointer = -I/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG= -mno-altivec -msoft-float -ffreestanding -fwrapv -fstack-protector = -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes = -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef = -Wno-pointer-sign -D__printf__=3D__freebsd_kprintf__ = -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas = -Wno-error-tautological-compare -Wno-error-empty-body = -Wno-error-parentheses-equality -Wno-error-unused-function = -Wno-error-pointer-sign -Wno-error-shift-negative-value = -Wno-error-address-of-packed-member -std=3Diso9899:1999 -c = /usr/src/sys/dev/mpt/mpt_cam.c -o mpt_cam.o CMD ctfconvert -L VERSION -g mpt_cam.o CWD = /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/m= odules/usr/src/sys/modules/mpt TARGET mpt_cam.o -- command output -- cc: error: unable to execute command: Segmentation fault (core dumped) cc: error: clang frontend command failed due to signal (use -v to see = invocation) FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on = LLVM 4.0.0) Target: powerpc-unknown-freebsd12.0 Thread model: posix InstalledDir: = /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/usr/bin cc: note: diagnostic msg: PLEASE submit a bug report to = https://bugs.freebsd.org/submit/ and include the crash backtrace, = preprocessed source, and associated run script. cc: note: diagnostic msg:=20 ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: cc: note: diagnostic msg: /tmp/mpt_cam-56fad4.c cc: note: diagnostic msg: /tmp/mpt_cam-56fad4.sh cc: note: diagnostic msg:=20 ******************** *** Error code 254 # more /tmp/mpt_cam-56fad4.sh # Crash reproducer for FreeBSD clang version 4.0.0 = (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0) # Driver args: "--target=3Dpowerpc-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" "-fno-strict-aliasing" "-D" "_KERNEL" "-D" "KLD_MODULE" = "-nostdinc" "-D" "HAVE_KERNEL_OPTION_HEADERS" "-include" = "/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/= opt_global.h" "-I" "." "-I" "/usr/src/sys" "-fno-common" "-g" = "-fno-omit-frame-pointer" "-I" = "/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG"= "-fno-altivec" "-msoft-float" "-ffreestanding" "-fwrapv" = "-fstack-protector" "-gdwarf-2" "-Wall" "-Wredundant-decls" = "-Wnested-externs" "-Wstrict-prototypes" "-Wmissing-prototypes" = "-Wpointer-arith" "-Winline" "-Wcast-qual" "-Wundef" "-Wno-pointer-sign" = "-D" "__printf__=3D__freebsd_kprintf__" "-Wmissing-include-dirs" = "-fdiagnostics-show-option" "-Wno-unknown-pragmas" = "-Wno-error-tautological-compare" "-Wno-error-empty-body" = "-Wno-error-parentheses-equality" "-Wno-error-unused-function" = "-Wno-error-pointer-sign" "-Wno-error-shift-negative-value" = "-Wno-error-address-of-packed-member" "-std=3Diso9899:1999" "-c" = "/usr/src/sys/dev/mpt/mpt_cam.c" "-o" "mpt_cam.o" # Original command: = "/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/usr/bin/cc" = "-cc1" "-triple" "powerpc-unknown-freebsd12.0" "-emit-obj" = "-disable-free" "-main-file-name" "mpt_cam.c" "-mrelocation-model" = "static" "-mthread-model" "posix" "-mdisable-fp-elim" = "-relaxed-aliasing" "-masm-verbose" "-mconstructor-aliases" = "-target-cpu" "ppc" "-target-feature" "-hard-float" "-target-feature" = "-altivec" "-msoft-float" "-mfloat-abi" "soft" "-dwarf-column-info" = "-debug-info-kind=3Dstandalone" "-dwarf-version=3D2" = "-debugger-tuning=3Dgdb" "-coverage-notes-file" = "/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/= modules/usr/src/sys/modules/mpt/mpt_cam.gcno" "-nostdsysteminc" = "-nobuiltininc" "-resource-dir" = "/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/usr/bin/../lib/cla= ng/4.0.0" "-include" = "/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/= opt_global.h" "-D" "_KERNEL" "-D" "KLD_MODULE" "-D" = "HAVE_KERNEL_OPTION_HEADERS" "-I" "." "-I" "/usr/src/sys" "-I" = "/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG"= "-D" "__printf__=3D__freebsd_kprintf__" "-isysroot" = "/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp" "-O2" "-Wall" = "-Wredundant-decls" "-Wnested-externs" "-Wstrict-prototypes" = "-Wmissing-prototypes" "-Wpointer-arith" "-Winline" "-Wcast-qual" = "-Wundef" "-Wno-pointer-sign" "-Wmissing-include-dirs" = "-Wno-unknown-pragmas" "-Wno-error-tautological-compare" = "-Wno-error-empty-body" "-Wno-error-parentheses-equality" = "-Wno-error-unused-function" "-Wno-error-pointer-sign" = "-Wno-error-shift-negative-value" "-Wno-error-address-of-packed-member" = "-std=3Diso9899:1999" "-fdebug-compilation-dir" = "/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/= modules/usr/src/sys/modules/mpt" "-ferror-limit" "19" "-fmessage-length" = "0" "-ffreestanding" "-fwrapv" "-stack-protector" "1" "-fno-signed-char" = "-fobjc-runtime=3Dgnustep" "-fno-common" "-fdiagnostics-show-option" = "-vectorize-loops" "-vectorize-slp" "-o" "mpt_cam.o" "-x" "c" = "/usr/src/sys/dev/mpt/mpt_cam.c" "/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/usr/bin/cc" = "-cc1" "-triple" "powerpc-unknown-freebsd12.0" "-emit-obj" = "-disable-free" "-main-file-name" "mpt_cam.c" "-mrelocation-model" = "static" "-mthread-model" "posix" "-mdisable-fp-elim" = "-relaxed-aliasing" "-masm-verbose" "-mconstructor-aliases" = "-target-cpu" "ppc" "-target-feature" "-hard-float" "-target-feature" = "-altivec" "-msoft-float" "-mfloat-abi" "soft" "-dwarf-column-info" = "-debug-info-kind=3Dstandalone" "-dwarf-version=3D2" = "-debugger-tuning=3Dgdb" "-coverage-notes-file" = "/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/= modules/usr/src/sys/modules/mpt/mpt_cam.gcno" "-nostdsysteminc" = "-nobuiltininc" "-D" "_KERNEL" "-D" "KLD_MODULE" "-D" = "HAVE_KERNEL_OPTION_HEADERS" "-D" "__printf__=3D__freebsd_kprintf__" = "-O2" "-Wall" "-Wredundant-decls" "-Wnested-externs" = "-Wstrict-prototypes" "-Wmissing-prototypes" "-Wpointer-arith" = "-Winline" "-Wcast-qual" "-Wundef" "-Wno-pointer-sign" = "-Wmissing-include-dirs" "-Wno-unknown-pragmas" = "-Wno-error-tautological-compare" "-Wno-error-empty-body" = "-Wno-error-parentheses-equality" "-Wno-error-unused-function" = "-Wno-error-pointer-sign" "-Wno-error-shift-negative-value" = "-Wno-error-address-of-packed-member" "-std=3Diso9899:1999" = "-ferror-limit" "19" "-fmessage-length" "0" "-ffreestanding" "-fwrapv" = "-stack-protector" "1" "-fno-signed-char" "-fobjc-runtime=3Dgnustep" = "-fno-common" "-fdiagnostics-show-option" "-vectorize-loops" = "-vectorize-slp" "-x" "c" "mpt_cam-56fad4.c" (The clang self-saved .c is too big to be here. A .xz variant is in llvm's 32908 .) =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Thu May 4 19:46:05 2017 Return-Path: Delivered-To: freebsd-toolchain@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 18A26D5D36E for ; Thu, 4 May 2017 19:46:05 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-78.reflexion.net [208.70.210.78]) (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 A15F696E for ; Thu, 4 May 2017 19:46:04 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 26712 invoked from network); 4 May 2017 19:39:23 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 4 May 2017 19:39:23 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Thu, 04 May 2017 15:39:23 -0400 (EDT) Received: (qmail 26729 invoked from network); 4 May 2017 19:39:23 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 4 May 2017 19:39:23 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id F13DDEC7C39; Thu, 4 May 2017 12:39:22 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: llvm FreeBSD powerpc ABI target bug fix: Re: [Bug 26519] Clang 4.0.0's "Target: powerpc-unknown-freebsd11.0" code generation is violating the SVR4 ABI (SEGV can result) Date: Thu, 4 May 2017 12:39:22 -0700 References: To: Dimitry Andric , FreeBSD Toolchain , FreeBSD PowerPC ML In-Reply-To: Message-Id: <0103401A-CEEA-4992-A45E-E60EA151119B@dsl-only.net> X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2017 19:46:05 -0000 I just got a report of a fix for the FreeBSD powerpc ABI's code generation in llvm. It should fix a stack handling related problem that currently makes clang (through 4) largely useless for TARGET_ARCH=3Dpowerpc . On 2017-May-4, at 12:26 PM, bugzilla-daemon@llvm.org wrote: > Comment # 19 on bug 26519 from Krzysztof Parzyszek > Committed a fix in r302183. >=20 > You are receiving this mail because: > =E2=80=A2 You reported the bug. This would also apply to: powerpc-unknown-freebsd12.0 not just 11.0 Hopefully it is an easy merge into clang 4. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Thu May 4 19:48:11 2017 Return-Path: Delivered-To: freebsd-toolchain@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 CCBCED5D4CE for ; Thu, 4 May 2017 19:48:11 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-77.reflexion.net [208.70.210.77]) (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 7A4F5A62 for ; Thu, 4 May 2017 19:48:10 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 17670 invoked from network); 4 May 2017 19:51:28 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 4 May 2017 19:51:28 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Thu, 04 May 2017 15:48:09 -0400 (EDT) Received: (qmail 10908 invoked from network); 4 May 2017 19:48:09 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 4 May 2017 19:48:09 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id BCFDFEC7C39; Thu, 4 May 2017 12:48:08 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: llvm FreeBSD powerpc ABI target bug fix: Re: [Bug 26519] Clang 4.0.0's "Target: powerpc-unknown-freebsd11.0" code generation is violating the SVR4 ABI (SEGV can result) Date: Thu, 4 May 2017 12:48:08 -0700 References: <0103401A-CEEA-4992-A45E-E60EA151119B@dsl-only.net> To: Dimitry Andric , FreeBSD Toolchain , FreeBSD PowerPC ML In-Reply-To: <0103401A-CEEA-4992-A45E-E60EA151119B@dsl-only.net> Message-Id: <83A99A4B-3F6A-437F-84C3-510359B303EE@dsl-only.net> X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2017 19:48:11 -0000 On 2017-May-4, at 12:39 PM, Mark Millard wrote: > I just got a report of a fix for the FreeBSD > powerpc ABI's code generation in llvm. It should > fix a stack handling related problem that > currently makes clang (through 4) largely useless > for TARGET_ARCH=3Dpowerpc . >=20 > On 2017-May-4, at 12:26 PM, bugzilla-daemon@llvm.org wrote: >=20 >> Comment # 19 on bug 26519 from Krzysztof Parzyszek >> Committed a fix in r302183. >>=20 >> You are receiving this mail because: >> =E2=80=A2 You reported the bug. >=20 > This would also apply to: >=20 > powerpc-unknown-freebsd12.0 >=20 > not just 11.0 >=20 > Hopefully it is an easy merge into > clang 4. And another notice, this time indicating a request for an official merge to 4.0.1: Begin forwarded message: From: bugzilla-daemon at llvm.org Subject: [Bug 26519] Clang 4.0.0's "Target: powerpc-unknown-freebsd11.0" = code generation is violating the SVR4 ABI (SEGV can result) Date: May 4, 2017 at 12:42:26 PM PDT To: Krzysztof Parzyszek changed bug 26519=20 What Removed Added Status REOPENED RESOLVED Resolution --- FIXED Comment # 20 on bug 26519 from Krzysztof Parzyszek Opened PR32930 to request merging this into 4.0.1. You are receiving this mail because: =E2=80=A2 You reported the bug. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Thu May 4 21:42:04 2017 Return-Path: Delivered-To: freebsd-toolchain@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 3649DD5E5C3; Thu, 4 May 2017 21:42:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (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 EDB5281B; Thu, 4 May 2017 21:42:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::4d79:8d91:26d1:3d20] (unknown [IPv6:2001:470:7a58:0:4d79:8d91:26d1:3d20]) (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 12EF33AC59; Thu, 4 May 2017 23:41:55 +0200 (CEST) From: Dimitry Andric Message-Id: <893ECA11-7C80-4D24-A496-92ADC7978A07@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_17DDA703-1B23-42AF-90DB-363455614ACF"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: llvm FreeBSD powerpc ABI target bug fix: Re: [Bug 26519] Clang 4.0.0's "Target: powerpc-unknown-freebsd11.0" code generation is violating the SVR4 ABI (SEGV can result) Date: Thu, 4 May 2017 23:41:39 +0200 In-Reply-To: <0103401A-CEEA-4992-A45E-E60EA151119B@dsl-only.net> Cc: FreeBSD Toolchain , FreeBSD PowerPC ML To: Mark Millard References: <0103401A-CEEA-4992-A45E-E60EA151119B@dsl-only.net> X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2017 21:42:04 -0000 --Apple-Mail=_17DDA703-1B23-42AF-90DB-363455614ACF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 4 May 2017, at 21:39, Mark Millard wrote: >=20 > I just got a report of a fix for the FreeBSD > powerpc ABI's code generation in llvm. It should > fix a stack handling related problem that > currently makes clang (through 4) largely useless > for TARGET_ARCH=3Dpowerpc . >=20 > On 2017-May-4, at 12:26 PM, bugzilla-daemon@llvm.org wrote: >=20 >> Comment # 19 on bug 26519 from Krzysztof Parzyszek >> Committed a fix in r302183. >>=20 >> You are receiving this mail because: >> =E2=80=A2 You reported the bug. >=20 > This would also apply to: >=20 > powerpc-unknown-freebsd12.0 >=20 > not just 11.0 >=20 > Hopefully it is an easy merge into > clang 4. Thanks for the notice. I have merged the upstream fix into head in r317810, and I will MFC it after a few days. -Dimitry --Apple-Mail=_17DDA703-1B23-42AF-90DB-363455614ACF 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 iEYEARECAAYFAlkLoCIACgkQsF6jCi4glqOCigCeJPAbPVmNQuzqFJMfnf/Bmw+k J9AAoPkJoGW36guBNq33FWsy7rpO50LZ =mbpM -----END PGP SIGNATURE----- --Apple-Mail=_17DDA703-1B23-42AF-90DB-363455614ACF-- From owner-freebsd-toolchain@freebsd.org Fri May 5 07:45:38 2017 Return-Path: Delivered-To: freebsd-toolchain@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 70505D5EDEC for ; Fri, 5 May 2017 07:45:38 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-77.reflexion.net [208.70.210.77]) (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 20D5A15C9 for ; Fri, 5 May 2017 07:45:37 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 15370 invoked from network); 5 May 2017 07:46:46 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 5 May 2017 07:46:46 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Fri, 05 May 2017 03:45:36 -0400 (EDT) Received: (qmail 11305 invoked from network); 5 May 2017 07:45:36 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 5 May 2017 07:45:36 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 7C729EC7ED9; Fri, 5 May 2017 00:45:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: llvm FreeBSD powerpc ABI target bug fix: Re: [Bug 26519] Clang 4.0.0's "Target: powerpc-unknown-freebsd11.0" code generation is violating the SVR4 ABI (SEGV can result) From: Mark Millard In-Reply-To: <893ECA11-7C80-4D24-A496-92ADC7978A07@FreeBSD.org> Date: Fri, 5 May 2017 00:45:34 -0700 Cc: Dimitry Andric , FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: <8F708AD1-055E-41BD-BD92-6A87C5FBAA60@dsl-only.net> References: <0103401A-CEEA-4992-A45E-E60EA151119B@dsl-only.net> <893ECA11-7C80-4D24-A496-92ADC7978A07@FreeBSD.org> To: FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 May 2017 07:45:38 -0000 On 2017-May-4, at 2:41 PM, Dimitry Andric wrote: > On 4 May 2017, at 21:39, Mark Millard wrote: >>=20 >> I just got a report of a fix for the FreeBSD >> powerpc ABI's code generation in llvm. It should >> fix a stack handling related problem that >> currently makes clang (through 4) largely useless >> for TARGET_ARCH=3Dpowerpc . >>=20 >> On 2017-May-4, at 12:26 PM, bugzilla-daemon@llvm.org wrote: >>=20 >>> Comment # 19 on bug 26519 from Krzysztof Parzyszek >>> Committed a fix in r302183. >>>=20 >>> You are receiving this mail because: >>> =E2=80=A2 You reported the bug. >>=20 >> This would also apply to: >>=20 >> powerpc-unknown-freebsd12.0 >>=20 >> not just 11.0 >>=20 >> Hopefully it is an easy merge into >> clang 4. >=20 > Thanks for the notice. I have merged the upstream fix into head in > r317810, and I will MFC it after a few days. I now have an old PowerMac running: # uname -paKU FreeBSD FBSDG4S 12.0-CURRENT FreeBSD 12.0-CURRENT r317820M powerpc = powerpc 1200030 1200030 where buildworld was via clang 4 (an amd64->powerpc cross build). Even the classic tiny program that previously showed C++ exception handling was broken and would crash the program now works when re-compiled and re-linked. Commands that were previous broken now work. (But my testing is nearly minimal at this point.) The kernel is from gcc421. I did try booting a kernel built by system-clang 4 and it got to: exec /sbin/init: error 13 and a later alignment exception at sf_buf_alloc+0x260 (Hand transcribed screen information.) This is the same as the last time that I tried such. The exception involved: exec_map_first_page kern_execve sys_execve start_init fork_exit fork_trampoline For the gcc 4.2.1 based kernel boot I have had one odd fatal kernel trap (0x903a64a, "unknown") where the lr showed 0x907f . It reported being stopped at: ffs_truncate+0x1080 It appears that "call doadump" worked but I've not looked at what was put in /var/crash/ . =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Fri May 5 08:23:01 2017 Return-Path: Delivered-To: freebsd-toolchain@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 87354D5E870 for ; Fri, 5 May 2017 08:23:01 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-77.reflexion.net [208.70.210.77]) (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 39133A2E for ; Fri, 5 May 2017 08:23:00 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 2159 invoked from network); 5 May 2017 08:26:18 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 5 May 2017 08:26:18 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Fri, 05 May 2017 04:22:59 -0400 (EDT) Received: (qmail 21919 invoked from network); 5 May 2017 08:22:58 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 5 May 2017 08:22:58 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 4EE72EC7ED9; Fri, 5 May 2017 01:22:58 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: llvm FreeBSD powerpc ABI target bug fix: Re: [Bug 26519] Clang 4.0.0's "Target: powerpc-unknown-freebsd11.0" code generation is violating the SVR4 ABI (SEGV can result) From: Mark Millard In-Reply-To: <8F708AD1-055E-41BD-BD92-6A87C5FBAA60@dsl-only.net> Date: Fri, 5 May 2017 01:22:57 -0700 Cc: FreeBSD Toolchain , Dimitry Andric Content-Transfer-Encoding: quoted-printable Message-Id: <78CD5050-2B2B-4213-AF11-7EF744F608B2@dsl-only.net> References: <0103401A-CEEA-4992-A45E-E60EA151119B@dsl-only.net> <893ECA11-7C80-4D24-A496-92ADC7978A07@FreeBSD.org> <8F708AD1-055E-41BD-BD92-6A87C5FBAA60@dsl-only.net> To: FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 May 2017 08:23:01 -0000 On 2017-May-5, at 12:45 AM, Mark Millard wrote: > On 2017-May-4, at 2:41 PM, Dimitry Andric wrote: >=20 >> . . . >> Thanks for the notice. I have merged the upstream fix into head in >> r317810, and I will MFC it after a few days. >=20 > I now have an old PowerMac running: >=20 > # uname -paKU > FreeBSD FBSDG4S 12.0-CURRENT FreeBSD 12.0-CURRENT r317820M powerpc = powerpc 1200030 1200030 >=20 > where buildworld was via clang 4 (an amd64->powerpc > cross build). Even the classic tiny program that > previously showed C++ exception handling was broken > and would crash the program now works when > re-compiled and re-linked. Commands that were > previous broken now work. >=20 > (But my testing is nearly minimal at this point.) >=20 > The kernel is from gcc421. >=20 >=20 >=20 > I did try booting a kernel built by system-clang 4 > and it got to: >=20 > exec /sbin/init: error 13 >=20 > and a later alignment exception at sf_buf_alloc+0x260 >=20 > (Hand transcribed screen information.) >=20 > This is the same as the last time that I tried > such. The exception involved: >=20 > exec_map_first_page > kern_execve > sys_execve > start_init > fork_exit > fork_trampoline >=20 >=20 >=20 > For the gcc 4.2.1 based kernel boot I have > had one odd fatal kernel trap (0x903a64a, > "unknown") where the lr showed 0x907f . It > reported being stopped at: >=20 > ffs_truncate+0x1080 >=20 > It appears that "call doadump" worked but > I've not looked at what was put in > /var/crash/ . If I leave the PowerMac idle running: # uname -paKU FreeBSD FBSDG4S 12.0-CURRENT FreeBSD 12.0-CURRENT r317820M powerpc = powerpc 1200030 1200030 it eventually gets the same ffs_truncate-tied fatal kernel trap, with the same odd lr and the like. So, while I cannot directly cause the problem at a specific time, the problem is repeatable. I did not build the kernel with a so-called "red-zone" to work around any stack-operation ordering problems that might still be around. But I do not know that such is involved here. It may be a while before I manage to get that much of an analysis done. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Sat May 6 01:11:14 2017 Return-Path: Delivered-To: freebsd-toolchain@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 52A9CD5D34E for ; Sat, 6 May 2017 01:11:14 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-78.reflexion.net [208.70.210.78]) (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 03D26ADC for ; Sat, 6 May 2017 01:11:13 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 3945 invoked from network); 6 May 2017 01:11:12 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 6 May 2017 01:11:12 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Fri, 05 May 2017 21:11:12 -0400 (EDT) Received: (qmail 20507 invoked from network); 6 May 2017 01:11:12 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 6 May 2017 01:11:12 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id A4878EC885D; Fri, 5 May 2017 18:11:11 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: llvm FreeBSD powerpc ABI target bug fix: Re: [Bug 26519] Clang 4.0.0's "Target: powerpc-unknown-freebsd11.0" code generation is violating the SVR4 ABI (SEGV can result) From: Mark Millard In-Reply-To: <78CD5050-2B2B-4213-AF11-7EF744F608B2@dsl-only.net> Date: Fri, 5 May 2017 18:11:11 -0700 Cc: FreeBSD PowerPC ML , FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: References: <0103401A-CEEA-4992-A45E-E60EA151119B@dsl-only.net> <893ECA11-7C80-4D24-A496-92ADC7978A07@FreeBSD.org> <8F708AD1-055E-41BD-BD92-6A87C5FBAA60@dsl-only.net> <78CD5050-2B2B-4213-AF11-7EF744F608B2@dsl-only.net> To: Dimitry Andric X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 May 2017 01:11:14 -0000 On 2017-May-5, at 1:22 AM, Mark Millard wrote: > On 2017-May-5, at 12:45 AM, Mark Millard = wrote: >=20 >> On 2017-May-4, at 2:41 PM, Dimitry Andric wrote: >>=20 >>> . . . >>> Thanks for the notice. I have merged the upstream fix into head in >>> r317810, and I will MFC it after a few days. >>=20 >> I now have an old PowerMac running: >>=20 >> # uname -paKU >> FreeBSD FBSDG4S 12.0-CURRENT FreeBSD 12.0-CURRENT r317820M powerpc = powerpc 1200030 1200030 >>=20 >> where buildworld was via clang 4 (an amd64->powerpc >> cross build). Even the classic tiny program that >> previously showed C++ exception handling was broken >> and would crash the program now works when >> re-compiled and re-linked. Commands that were >> previous broken now work. I messed up and accidentally installed the gcc 4.2.1 world that I had also built. This is why C++ exceptions appeared to be working for powerpc. Both TARGET_ARCH=3Dpowerpc and TARGET_ARCH=3Dpowerpc64 have C++ exceptions still messed up. >> (But my testing is nearly minimal at this point.) >>=20 >> The kernel is from gcc421. >>=20 >>=20 >>=20 >> I did try booting a kernel built by system-clang 4 >> and it got to: >>=20 >> exec /sbin/init: error 13 >>=20 >> and a later alignment exception at sf_buf_alloc+0x260 >>=20 >> (Hand transcribed screen information.) >>=20 >> This is the same as the last time that I tried >> such. The exception involved: >>=20 >> exec_map_first_page >> kern_execve >> sys_execve >> start_init >> fork_exit >> fork_trampoline >>=20 >>=20 >>=20 >> For the gcc 4.2.1 based kernel boot I have >> had one odd fatal kernel trap (0x903a64a, >> "unknown") where the lr showed 0x907f . It >> reported being stopped at: >>=20 >> ffs_truncate+0x1080 >>=20 >> It appears that "call doadump" worked but >> I've not looked at what was put in >> /var/crash/ . >=20 > If I leave the PowerMac idle running: >=20 > # uname -paKU > FreeBSD FBSDG4S 12.0-CURRENT FreeBSD 12.0-CURRENT r317820M powerpc = powerpc 1200030 1200030 >=20 > it eventually gets the same ffs_truncate-tied fatal > kernel trap, with the same odd lr and the like. >=20 > So, while I cannot directly cause the problem > at a specific time, the problem is repeatable. >=20 > I did not build the kernel with a so-called > "red-zone" to work around any stack-operation > ordering problems that might still be around. > But I do not know that such is involved here. > It may be a while before I manage to get that > much of an analysis done. The ffs_truncate issue is odd: A) It was gcc 4.2.1 based for both kernel and world. B) I built a gcc 4.2.1 based debug kernel and installed it but that does not get the problem. I sam trying the gcc 4.2.1 debug kernel with the system clang 4 world now and will later switch to the gcc 4.2.1 non-debug kernel to see what happens. But being a pure gcc 4.2.1 environment originally suggests that the ffs_truncate issue is not clang-toolchain related. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Sat May 6 05:13:16 2017 Return-Path: Delivered-To: freebsd-toolchain@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 54140D603FC for ; Sat, 6 May 2017 05:13:16 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-78.reflexion.net [208.70.210.78]) (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 17CD6E5A for ; Sat, 6 May 2017 05:13:15 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 19162 invoked from network); 6 May 2017 05:13:14 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 6 May 2017 05:13:14 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Sat, 06 May 2017 01:13:14 -0400 (EDT) Received: (qmail 6315 invoked from network); 6 May 2017 05:13:13 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 6 May 2017 05:13:13 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 240A6EC7DD3; Fri, 5 May 2017 22:13:13 -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: Re: llvm FreeBSD powerpc ABI target bug fix: Re: [Bug 26519] Clang 4.0.0's "Target: powerpc-unknown-freebsd11.0" code generation is violating the SVR4 ABI (SEGV can result) Date: Fri, 5 May 2017 22:13:12 -0700 References: <0103401A-CEEA-4992-A45E-E60EA151119B@dsl-only.net> <893ECA11-7C80-4D24-A496-92ADC7978A07@FreeBSD.org> <8F708AD1-055E-41BD-BD92-6A87C5FBAA60@dsl-only.net> <78CD5050-2B2B-4213-AF11-7EF744F608B2@dsl-only.net> To: FreeBSD Toolchain , FreeBSD PowerPC ML In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 May 2017 05:13:16 -0000 On 2017-May-5, at 6:11 PM, Mark Millard wrote: > On 2017-May-5, at 1:22 AM, Mark Millard wrote: >=20 >> On 2017-May-5, at 12:45 AM, Mark Millard = wrote: >>=20 >>> On 2017-May-4, at 2:41 PM, Dimitry Andric = wrote: >>>=20 >>>> . . . >>>> Thanks for the notice. I have merged the upstream fix into head in >>>> r317810, and I will MFC it after a few days. >>>=20 >>> I now have an old PowerMac running: >>>=20 >>> # uname -paKU >>> FreeBSD FBSDG4S 12.0-CURRENT FreeBSD 12.0-CURRENT r317820M powerpc = powerpc 1200030 1200030 >>>=20 >>> where buildworld was via clang 4 (an amd64->powerpc >>> cross build). Even the classic tiny program that >>> previously showed C++ exception handling was broken >>> and would crash the program now works when >>> re-compiled and re-linked. Commands that were >>> previous broken now work. >=20 > I messed up and accidentally installed the > gcc 4.2.1 world that I had also built. This > is why C++ exceptions appeared to be working > for powerpc. >=20 > Both TARGET_ARCH=3Dpowerpc and TARGET_ARCH=3Dpowerpc64 > have C++ exceptions still messed up. >=20 >=20 >>> . . . >>>=20 >>> For the gcc 4.2.1 based kernel boot I have >>> had one odd fatal kernel trap (0x903a64a, >>> "unknown") where the lr showed 0x907f . It >>> reported being stopped at: >>>=20 >>> ffs_truncate+0x1080 >>>=20 >>> It appears that "call doadump" worked but >>> I've not looked at what was put in >>> /var/crash/ . >>=20 >> If I leave the PowerMac idle running: >>=20 >> # uname -paKU >> FreeBSD FBSDG4S 12.0-CURRENT FreeBSD 12.0-CURRENT r317820M powerpc = powerpc 1200030 1200030 >>=20 >> it eventually gets the same ffs_truncate-tied fatal >> kernel trap, with the same odd lr and the like. >>=20 >> So, while I cannot directly cause the problem >> at a specific time, the problem is repeatable. >>=20 >> I did not build the kernel with a so-called >> "red-zone" to work around any stack-operation >> ordering problems that might still be around. >> But I do not know that such is involved here. >> It may be a while before I manage to get that >> much of an analysis done. >=20 > The ffs_truncate issue is odd: >=20 > A) It was gcc 4.2.1 based for both kernel and world. > B) I built a gcc 4.2.1 based debug kernel and > installed it but that does not get the problem. >=20 > I sam trying the gcc 4.2.1 debug kernel with the > system clang 4 world now and will later switch > to the gcc 4.2.1 non-debug kernel to see what > happens. >=20 > But being a pure gcc 4.2.1 environment originally > suggests that the ffs_truncate issue is not > clang-toolchain related. I found a bad (old) kernel module in /boot/kernel/ and eliminating it appears to have removed the ffs_truncate problem. And even more good news: buildworld buildkernel makes extensive use of signals and its failure is how I discovered the original stack handling problems for powerpc (the ABI violations). I used to have to patch in so-called "red zone" handling to avoid the issue. No more: a running a kernel that was built without a "red zone" and running a world based on clang now allows buildworld buildkernel to complete just fine: no evidence of ABI violations in the world code that is executed. Going the other direction: I've conformed that clang still generates C++ programs that can not handle thrown exceptions. Both powerpc and powerpc64 are this way. The only other area with an issue that I know of is the exec /sbin/init failure that prevents using the clang based kernel for powerpc. (This is based on the system binutils for powerpc and devel/*binutils for powerpc64 instead of lld and such. lld has its own problems for these targets.) I already build and run powerpc64 kernels built by clang. That has been true for a while. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Sat May 6 07:06:15 2017 Return-Path: Delivered-To: freebsd-toolchain@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 D2213D600F0 for ; Sat, 6 May 2017 07:06:15 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-77.reflexion.net [208.70.210.77]) (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 732081502 for ; Sat, 6 May 2017 07:06:14 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 8925 invoked from network); 6 May 2017 07:06:07 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 6 May 2017 07:06:07 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Sat, 06 May 2017 03:06:07 -0400 (EDT) Received: (qmail 7540 invoked from network); 6 May 2017 07:06:07 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 6 May 2017 07:06:07 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 0C1FDEC7ED9; Sat, 6 May 2017 00:06:07 -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: Re: llvm FreeBSD powerpc ABI target bug fix: Re: [Bug 26519] Clang 4.0.0's "Target: powerpc-unknown-freebsd11.0" code generation is violating the SVR4 ABI (SEGV can result) Date: Sat, 6 May 2017 00:06:06 -0700 References: <0103401A-CEEA-4992-A45E-E60EA151119B@dsl-only.net> <893ECA11-7C80-4D24-A496-92ADC7978A07@FreeBSD.org> <8F708AD1-055E-41BD-BD92-6A87C5FBAA60@dsl-only.net> <78CD5050-2B2B-4213-AF11-7EF744F608B2@dsl-only.net> To: FreeBSD Toolchain , FreeBSD PowerPC ML In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 May 2017 07:06:16 -0000 On 2017-May-5, at 10:13 PM, Mark Millard wrote: > On 2017-May-5, at 6:11 PM, Mark Millard wrote: >=20 >>>> . . . >>>>=20 >>>> For the gcc 4.2.1 based kernel boot I have >>>> had one odd fatal kernel trap (0x903a64a, >>>> "unknown") where the lr showed 0x907f . It >>>> reported being stopped at: >>>>=20 >>>> ffs_truncate+0x1080 >>>>=20 >>>> It appears that "call doadump" worked but >>>> I've not looked at what was put in >>>> /var/crash/ . >>>=20 >>> If I leave the PowerMac idle running: It also happens when busy. >>> # uname -paKU >>> FreeBSD FBSDG4S 12.0-CURRENT FreeBSD 12.0-CURRENT r317820M powerpc = powerpc 1200030 1200030 >>>=20 >>> it eventually gets the same ffs_truncate-tied fatal >>> kernel trap, with the same odd lr and the like. >>>=20 >>> So, while I cannot directly cause the problem >>> at a specific time, the problem is repeatable. >>>=20 >>> . . . >>=20 >> The ffs_truncate issue is odd: >>=20 >> A) It was gcc 4.2.1 based for both kernel and world. >> B) I built a gcc 4.2.1 based debug kernel and >> installed it but that does not get the problem. >>=20 >> I sam trying the gcc 4.2.1 debug kernel with the >> system clang 4 world now and will later switch >> to the gcc 4.2.1 non-debug kernel to see what >> happens. >>=20 >> But being a pure gcc 4.2.1 environment originally >> suggests that the ffs_truncate issue is not >> clang-toolchain related. >=20 > I found a bad (old) kernel module in /boot/kernel/ > and eliminating it appears to have removed the > ffs_truncate problem. >=20 > . . . For the ffs_truncate problem I spoke too soon: It happened again, this time while the old PowerMac was busy. The detail numbers and such were again the same. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Sat May 6 09:59:43 2017 Return-Path: Delivered-To: freebsd-toolchain@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 A0AABD5D7F3 for ; Sat, 6 May 2017 09:59:43 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-77.reflexion.net [208.70.210.77]) (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 4A59FD77 for ; Sat, 6 May 2017 09:59:42 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 5495 invoked from network); 6 May 2017 09:59:40 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 6 May 2017 09:59:40 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Sat, 06 May 2017 05:59:40 -0400 (EDT) Received: (qmail 25212 invoked from network); 6 May 2017 09:59:40 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 6 May 2017 09:59:40 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id A2B16EC7DD3; Sat, 6 May 2017 02:59:39 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: llvm FreeBSD powerpc ABI target bug fix: Re: [Bug 26519] Clang 4.0.0's "Target: powerpc-unknown-freebsd11.0" code generation is violating the SVR4 ABI (SEGV can result) From: Mark Millard In-Reply-To: Date: Sat, 6 May 2017 02:59:39 -0700 Cc: Dimitry Andric Content-Transfer-Encoding: quoted-printable Message-Id: <528DD22A-D880-4BA1-8FA8-BB9CC5004434@dsl-only.net> References: <0103401A-CEEA-4992-A45E-E60EA151119B@dsl-only.net> <893ECA11-7C80-4D24-A496-92ADC7978A07@FreeBSD.org> <8F708AD1-055E-41BD-BD92-6A87C5FBAA60@dsl-only.net> <78CD5050-2B2B-4213-AF11-7EF744F608B2@dsl-only.net> To: FreeBSD Toolchain , FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 May 2017 09:59:43 -0000 [I'm top posting a find of another stack handling failure example from the updated compiler for TARGET_ARCH=3Dpowerpc .] Bad news: Another code generation error, this time demonstrated in compiling part of perl5. . . (I tried to build a port that indirectly tried build perl5 but perl5's miniperl crashes.) /usr/obj/portswork/usr/ports/lang/perl5.24/work/perl-5.24.1/numeric.c has Perl_cast_iv(NV f) for which clang double stores two different things to one address [24(r1)]. Below the =3D> lines are the double store, the second destroying the r30 value that was saved in the first: Dump of assembler code for function Perl_cast_iv: 0x0196a114 <+0>: mflr r0 0x0196a118 <+4>: stw r0,4(r1) 0x0196a11c <+8>: stwu r1,-32(r1) 0x0196a120 <+12>: stw r31,28(r1) =3D> 0x0196a124 <+16>: stw r30,24(r1) 0x0196a128 <+20>: mr r31,r1 0x0196a12c <+24>: mfcr r12 =3D> 0x0196a130 <+28>: stw r12,24(r31) Note: r31 =3D=3D r1 for that second "=3D>" line. The return code sequence has a similar problem: two loads from the same address for what should be distinct values. Note: r31 =3D=3D r1 here too. =3D> 0x0196a1bc <+168>: lwz r12,24(r31) 0x0196a1c0 <+172>: lwz r0,36(r1) 0x0196a1c4 <+176>: lwz r31,28(r1) =3D> 0x0196a1c8 <+180>: lwz r30,24(r1) 0x0196a1cc <+184>: mtcrf 32,r12 0x0196a1d0 <+188>: addi r1,r1,32 0x0196a1d4 <+192>: mtlr r0 0x0196a1d8 <+196>: blr The Perl_cast_iv source code looks like: IV Perl_cast_iv(NV f) { if (f < IV_MAX_P1) return f < IV_MIN ? IV_MIN : (IV) f; if (f < UV_MAX_P1) { #if CASTFLAGS & 2 /* For future flexibility allowing for sizeof(UV) >=3D sizeof(IV) = */ if (f < UV_MAX_P1_HALF) return (IV)(UV) f; f -=3D UV_MAX_P1_HALF; return (IV)(((UV) f) | (1 + (UV_MAX >> 1))); #else return (IV)(UV) f; #endif } return f > 0 ? (IV)UV_MAX : 0 /* NaN */; } This sort of thing might explain the occasional panic that names ffs_truncate if there is some infrequently used routine that messes up the stack. On 2017-May-6, at 12:06 AM, Mark Millard wrote: > On 2017-May-5, at 10:13 PM, Mark Millard = wrote: >=20 >=20 >> On 2017-May-5, at 6:11 PM, Mark Millard = wrote: >>=20 >>>>> . . . >>>>>=20 >>>>> For the gcc 4.2.1 based kernel boot I have >>>>> had one odd fatal kernel trap (0x903a64a, >>>>> "unknown") where the lr showed 0x907f . It >>>>> reported being stopped at: >>>>>=20 >>>>> ffs_truncate+0x1080 >>>>>=20 >>>>> It appears that "call doadump" worked but >>>>> I've not looked at what was put in >>>>> /var/crash/ . >>>>=20 >>>> If I leave the PowerMac idle running: >=20 > It also happens when busy. >=20 >>>> # uname -paKU >>>> FreeBSD FBSDG4S 12.0-CURRENT FreeBSD 12.0-CURRENT r317820M = powerpc powerpc 1200030 1200030 >>>>=20 >>>> it eventually gets the same ffs_truncate-tied fatal >>>> kernel trap, with the same odd lr and the like. >>>>=20 >>>> So, while I cannot directly cause the problem >>>> at a specific time, the problem is repeatable. >>>>=20 >>>> . . . >>>=20 >>> The ffs_truncate issue is odd: >>>=20 >>> A) It was gcc 4.2.1 based for both kernel and world. >>> B) I built a gcc 4.2.1 based debug kernel and >>> installed it but that does not get the problem. >>>=20 >>> I sam trying the gcc 4.2.1 debug kernel with the >>> system clang 4 world now and will later switch >>> to the gcc 4.2.1 non-debug kernel to see what >>> happens. >>>=20 >>> But being a pure gcc 4.2.1 environment originally >>> suggests that the ffs_truncate issue is not >>> clang-toolchain related. >>=20 >> I found a bad (old) kernel module in /boot/kernel/ >> and eliminating it appears to have removed the >> ffs_truncate problem. >>=20 >> . . . >=20 > For the ffs_truncate problem I spoke too > soon: It happened again, this time while > the old PowerMac was busy. >=20 > The detail numbers and such were again the > same. =3D=3D=3D Mark Millard markmi at dsl-only.net