From owner-freebsd-toolchain@freebsd.org Sat Jan 9 03:46:15 2016 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 B6705A680CB for ; Sat, 9 Jan 2016 03:46:15 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-3.reflexion.net [208.70.210.3]) (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 71E171BCF for ; Sat, 9 Jan 2016 03:46:14 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 22983 invoked from network); 9 Jan 2016 03:46:08 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 9 Jan 2016 03:46:08 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Fri, 08 Jan 2016 22:46:05 -0500 (EST) Received: (qmail 15542 invoked from network); 9 Jan 2016 03:46:05 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 9 Jan 2016 03:46:05 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.8] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 116551C43CA; Fri, 8 Jan 2016 19:46:01 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: Bug 205663 Clang getting Bus Errors (arm SCLTR Bit[12]==1 context): Reported fixed on llvm's trunk From: Mark Millard In-Reply-To: <7EE8F65E-7485-4FA9-A136-F22090DB107F@FreeBSD.org> Date: Fri, 8 Jan 2016 19:46:06 -0800 Cc: Ian Lepore , Warner Losh , freebsd-arm , FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: <92264003-CF0E-4624-A28A-8AFB7C663BFB@dsl-only.net> References: <1452020032.1320.21.camel@freebsd.org> <7EE8F65E-7485-4FA9-A136-F22090DB107F@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.2104) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.20 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, 09 Jan 2016 03:46:15 -0000 On 2016-Jan-7, at 2:57 PM, Dimitry Andric wrote: >=20 > On 05 Jan 2016, at 19:53, Ian Lepore wrote: >>=20 >> On Tue, 2016-01-05 at 11:35 -0700, Warner Losh wrote: > ... >>> There's a projects/clang-380-import that you might want to try... >>=20 >> It's a non-starter for us, because unfortunately they appear to have >> removed support for the -arm-use-movt=3D0 command line option, so now = we >> can't build ubldr or kernel modules. >=20 > FYI, I have added a -mno-movt option for this purpose upstream, and > imported a newer snapshot into the clang380-import branch. As of > r293384, it now uses the new option spelling for modules, if your = clang > is 3.8.0 or higher. >=20 > -Dimitry I've not been able to get to the point of running clang++ 3.8 on the = rpi2 yet: R_ARM_CALL and R_ARM_JUMP24 relocation truncations during the = cross build's buildworld interfere. I've no clue just what you expect the status of things to be so this = note is just an FYI on what happened when I tried to cross build from an = amd64 context targetting an armv6 context, also using "-march=3Darmv7a = -mcpu=3Dcortex-a7 -mno-unaligned-access". Yesterday I cloned an amd64 virtual box virtual machine that I run = FreeBSD 11.0-CURRENT in and updated the cloned copy's /usr/src/ to = base/projects/clang380-import -r293417. buildworld, buildkernel and the = installs for amd64 went fine. Then today I updated /usr/src to -r293430 and attempted buildworld = buildkernel targeting armv6 with "-march=3Darmv7a -mcpu=3Dcortex-a7 = -mno-unaligned-access". I ended up with: > --- all_subdir_clang --- > clang++: error: linker command failed with exit code 1 (use -v to see = invocation) > *** [clang.full] Error code 1 Looking in the script output I find relocation truncation notices for = R_ARM_CALL and R_ARM_JUMP24 usage: > --- all_subdir_usr.bin --- > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/crt1.o: In function = `__start': . . . > --- all_subdir_usr.bin --- > /usr/src/lib/csu/arm/crt1.c:(.text+0xc4): relocation truncated to fit: = R_ARM_CALL against symbol `atexit' defined in .text section in = /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc.a(atexit.o) . . . > --- all_subdir_usr.bin --- > /usr/src/lib/csu/arm/crt1.c:(.text+0xcc): relocation truncated to fit: = R_ARM_CALL against symbol `_init_tls' defined in .text section in = /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc.a(tls.o) > /usr/src/lib/csu/arm/crt1.c:(.text+0xe0): relocation truncated to fit: = R_ARM_CALL against symbol `atexit' defined in .text section in = /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc.a(atexit.o) > /usr/src/lib/csu/arm/crt1.c:(.text+0x19c): relocation truncated to = fit: R_ARM_JUMP24 against symbol `exit' defined in .text section in = /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc.a(exit.o) > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/crt1.o: In function = `finalizer': > /usr/src/lib/csu/arm/crt1.c:(.text+0x1f8): relocation truncated to = fit: R_ARM_JUMP24 against symbol `_fini' defined in .fini section in = /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/crti.o . . . > --- all_subdir_usr.bin --- > cc1_main.o: In function `cc1_main(llvm::ArrayRef, char = const*, void*)': . . . > --- all_subdir_usr.bin --- > = /usr/src/usr.bin/clang/clang/../../../contrib/llvm/tools/clang/tools/drive= r/cc1_main.cpp:68: relocation truncated to fit: R_ARM_CALL against = symbol `operator new(unsigned int)' defined in .text section in = /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(new.o) . . . > --- all_subdir_usr.bin --- > cc1_main.o: In function `std::__1::__allocate(unsigned int)': > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/include/c++/v1/new:168: = relocation truncated to fit: R_ARM_CALL against symbol `operator = new(unsigned int)' defined in .text section in = /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(new.o) . . . > --- all_subdir_usr.bin --- > cc1_main.o: In function `~shared_ptr': > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/include/c++/v1/memory:4567: = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__shared_weak_count::__release_shared()' defined in .text = section in = /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(memory.o) > cc1_main.o: In function `cc1_main(llvm::ArrayRef, char = const*, void*)': > = /usr/src/usr.bin/clang/clang/../../../contrib/llvm/tools/clang/tools/drive= r/cc1_main.cpp:69: relocation truncated to fit: R_ARM_CALL against = symbol `operator new(unsigned int)' defined in .text section in = /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(new.o) > cc1_main.o: In function `shared_ptr': > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/include/c++/v1/memory:4254: = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__shared_weak_count::__add_shared()' defined in .text section = in /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(memory.o) > cc1_main.o: In function = `_ZN4llvm11make_uniqueIN5clang28ObjectFilePCHContainerWriterEJEEENSt3__19e= nable_ifIXntsr3std8is_arrayIT_EE5valueENS3_10unique_ptrIS5_NS3_14default_d= eleteIS5_EEEEE4typeEDpOT0_': > = /usr/src/usr.bin/clang/clang/../../../contrib/llvm/include/llvm/ADT/STLExt= ras.h:405: additional relocation overflows omitted from the output I have -v in the command line options. I later show the link command and = -v output (with lots of paths omitted). First I show my src.conf = content: > TO_TYPE=3Darmv6 > TOOLS_TO_TYPE=3Darm-gnueabi > # > KERNCONF=3DRPI2-NODBG > TARGET=3Darm > .if ${.MAKE.LEVEL} =3D=3D 0 > TARGET_ARCH=3D${TO_TYPE} > .export TARGET_ARCH > .endif > # > WITH_FAST_DEPEND=3D > WITH_LIBCPLUSPLUS=3D > WITH_BINTOOLS_BOOTSTRAP=3D > WITH_CLANG=3D > WITH_CLANG_IS_CC=3D > WITH_CLANG_FULL=3D > WITH_LLDB=3D > WITH_CLANG_EXTRAS=3D > WITH_BOOT=3D > # > WITHOUT_LIB32=3D > WITHOUT_ELFTOOLCHAIN_BOOTSTRAP=3D > WITHOUT_CLANG_BOOTSTRAP=3D > WITHOUT_GCC_BOOTSTRAP=3D > WITHOUT_GCC=3D > WITHOUT_GNUCXX=3D > # > NO_WERROR=3D > MALLOC_PRODUCTION=3D > # > WITH_DEBUG=3D > WITH_DEBUG_FILES=3D > # > .if ${.MAKE.LEVEL} =3D=3D 0 > XCC=3D/usr/bin/clang -v -target ${TO_TYPE}--freebsd11.0-gnueabi = -march=3Darmv7a -mcpu=3Dcortex-a7 -mno-unaligned-access > XCXX=3D/usr/bin/clang++ -v -target ${TO_TYPE}--freebsd11.0-gnueabi = -march=3Darmv7a -mcpu=3Dcortex-a7 -mno-unaligned-access > XCPP=3D/usr/bin/clang-cpp -v -target ${TO_TYPE}--freebsd11.0-gnueabi = -march=3Darmv7a -mcpu=3Dcortex-a7 -mno-unaligned-access > .export XCC > .export XCXX > .export XCPP > .endif > # > .if ${.MAKE.LEVEL} =3D=3D 0 > CC=3D/usr/bin/clang -v > CXX=3D/usr/bin/clang++ -v > CPP=3D/usr/bin/clang-cpp -v > .export CC > .export CXX > .export CPP > .endif As for the link command: > --- clang.full --- > /usr/bin/clang++ -v -target armv6--freebsd11.0-gnueabi -march=3Darmv7a = -mcpu=3Dcortex-a7 -mno-unaligned-access -target = armv6-gnueabi-freebsd11.0 --sysroot=3D/usr/obj/clang/arm.armv6/usr/src/tmp= -B/usr/obj/clang/arm.armv6/usr/src/tmp/usr/bin = --sysroot=3D/usr/obj/clang/arm.armv6/usr/src/tmp = -B/usr/obj/clang/arm.armv6/usr/src/tmp/usr/bin -O -pipe = -mfloat-abi=3Dsoftfp = -I/usr/src/usr.bin/clang/clang/../../../contrib/llvm/include = -I/usr/src/usr.bin/clang/clang/../../../contrib/llvm/tools/clang/include = -I/usr/src/usr.bin/clang/clang/../../../contrib/llvm/tools/clang/tools/dri= ver -I. = -I/usr/src/usr.bin/clang/clang/../../../contrib/llvm/../../lib/clang/inclu= de -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS = -D__STDC_CONSTANT_MACROS -DCLANG_ENABLE_ARCMT = -DCLANG_ENABLE_STATIC_ANALYZER -fno-strict-aliasing = -DLLVM_DEFAULT_TARGET_TRIPLE=3D\"armv6-gnueabi-freebsd11.0\" = -DLLVM_HOST_TRIPLE=3D\"armv6-unknown-freebsd11.0\" = -DDEFAULT_SYSROOT=3D\"\" -g -Qunused-arguments -std=3Dc++11 = -fno-exceptions -fno-rtti -stdlib=3Dlibc++ -Wno-c++11-extensions = -static -o clang.full cc1_main.o cc1as_main.o driver.o = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/clang/../../../lib/clang/li= bclangfrontendtool/libclangfrontendtool.a . . . > = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/clang/../../../lib/clang/li= bllvmsupport/libllvmsupport.a -lz -lncursesw -lpthread > FreeBSD clang version 3.8.0 (trunk 256945) (based on LLVM 3.8.0svn) > Target: armv6--freebsd11.0-gnueabi > Thread model: posix > InstalledDir: /usr/bin > "/usr/obj/clang/arm.armv6/usr/src/tmp/usr/bin/ld" = --sysroot=3D/usr/obj/clang/arm.armv6/usr/src/tmp -Bstatic -o clang.full = /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/crt1.o=20 . . . > = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/clang/../../../lib/clang/li= bllvmsupport/libllvmsupport.a -lz -lncursesw -lpthread -lc++ -lm -lgcc = -lgcc_eh -lc -lgcc -lgcc_eh = /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/crtend.o = /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/crtn.o =3D=3D=3D Mark Millard markmi at dsl-only.net