From owner-freebsd-toolchain@freebsd.org Sun Jan 10 11:55:42 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 A69FAA6B992 for ; Sun, 10 Jan 2016 11:55:42 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-4.reflexion.net [208.70.210.4]) (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 669EC1CD7 for ; Sun, 10 Jan 2016 11:55:41 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 5083 invoked from network); 10 Jan 2016 11:55:44 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 10 Jan 2016 11:55:44 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Sun, 10 Jan 2016 06:55:37 -0500 (EST) Received: (qmail 26680 invoked from network); 10 Jan 2016 11:55:37 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 10 Jan 2016 11:55:37 -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 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 58FCD1C43AE; Sun, 10 Jan 2016 03:55:33 -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: <1452365750.1523.9.camel@freebsd.org> Date: Sun, 10 Jan 2016 03:55:34 -0800 Cc: freebsd-arm , FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: <831D8A96-51D6-4E34-B422-A20857B6769E@dsl-only.net> References: <1452020032.1320.21.camel@freebsd.org> <7EE8F65E-7485-4FA9-A136-F22090DB107F@FreeBSD.org> <92264003-CF0E-4624-A28A-8AFB7C663BFB@dsl-only.net> <39774562-F76E-41E9-85E7-ABE257B013D6@FreeBSD.org> <1452365750.1523.9.camel@freebsd.org> To: Dimitry Andric , Ian Lepore 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: Sun, 10 Jan 2016 11:55:42 -0000 On 2016-Jan-9, at 10:55 AM, Ian Lepore wrote: >=20 > On Sat, 2016-01-09 at 15:03 +0100, Dimitry Andric wrote: >> On 09 Jan 2016, at 04:46, Mark Millard wrote: >>>=20 >>> On 2016-Jan-7, at 2:57 PM, Dimitry Andric >>> wrote: >> ... >>>> 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 >>>=20 >>> 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. >>=20 >> Yes, this is caused by too large call distances. In other words, the >> clang executable is getting to big to link. Apparently we need to do >> some tricks with -mlongcall to fix this. As I am no arm expert, I >> welcome any patch submissions. :-) >>=20 >> -Dimitry >>=20 >=20 > Here's the patch I got from Andy for the clang380 branch, modified = with > Warner's suggestion to use MACHINE_CPUARCH instead of MACHINE. With > this I can get a working arm world that will build a runnable > helloworld.c (and .cc) on a dreamplug. (I.e., it appears clang 3.8.0 > fixes the problem we had with clang 3.7.x where it wouldn't run at all > on armv4/5 systems). I have not tried compling anything complex yet. >=20 > -- Ian Context: When I build I normally build lldb and the like as well, even = using WITH_CLANG_EXTRAS=3D . In trying to get lldb to link I eventually get to the point that libc++ = is getting relocation truncations. Before getting to that I deal with = /usr/src/usr.bin/clang/lldb/Makefile to cover what is initially reported = during buildworld for lldb relocation truncations. Then with that in = place and retrying I get reports from libc++.a for a couple of the = contained .o files having relocations that are truncated (before it = reports "additional relocation overflows omitted from the output"): /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(thread.o) /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o) (Both have messages from multiple places in each .o file.) As far as I can tell for general use -long-calls is going to be needed = for at least some system level .a library content if the .a's are to be = used. Which leaves me wondering if STATIC_CXXFLAGS having -mlong-calls for arm = system libraries fairly generally is appropriate for those intending on = building the arm-native clang toolchain and related material in = buildworld. (STATIC_CFLAGS too?) A significant case analysis of what = happens to currently be too far apart would be fragile as things grow = even more later. This sort of issue may well not be limited to TARGET=3Darm contexts. The detailed libc++.a relocation truncation complaints that I got were: > --- all_subdir_lldb --- > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(thread.o): In = function = `_ZNSt3__16vectorINS_4pairIPNS_18condition_variableEPNS_5mutexEEENS_18__hi= dden_allocatorIS6_EEE21__push_back_slow_pathIS6_EEvOT_': > = /usr/src/lib/libc++/../../contrib/libc++/src/thread.cpp:(.text._ZNSt3__16v= ectorINS_4pairIPNS_18condition_variableEPNS_5mutexEEENS_18__hidden_allocat= orIS6_EEE21__push_back_slow_pathIS6_EEvOT_[_ZNSt3__16vectorINS_4pairIPNS_1= 8condition_variableEPNS_5mutexEEENS_18__hidden_allocatorIS6_EEE21__push_ba= ck_slow_pathIS6_EEvOT_]+0x30): relocation truncated to fit: R_ARM_CALL = against symbol = `std::__1::__vector_base_common::__throw_length_error() const' = defined in = .text._ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv[_ZNKS= t3__120__vector_base_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(thread.o): In = function = `_ZNSt3__16vectorIPNS_17__assoc_sub_stateENS_18__hidden_allocatorIS2_EEE21= __push_back_slow_pathIRKS2_EEvOT_': > = /usr/src/lib/libc++/../../contrib/libc++/src/thread.cpp:(.text._ZNSt3__16v= ectorIPNS_17__assoc_sub_stateENS_18__hidden_allocatorIS2_EEE21__push_back_= slow_pathIRKS2_EEvOT_[_ZNSt3__16vectorIPNS_17__assoc_sub_stateENS_18__hidd= en_allocatorIS2_EEE21__push_back_slow_pathIRKS2_EEvOT_]+0x30): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__vector_base_common::__throw_length_error() const' = defined in = .text._ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv[_ZNKS= t3__120__vector_base_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) . . . > --- all_subdir_clang --- > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_compare(char const*, char = const*, char const*, char const*) const': . . . > --- all_subdir_clang --- > = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x81ec): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) . . . > --- all_subdir_clang --- > = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x82c0): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_transform(char const*, char = const*) const': > = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x8430): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_compare(wchar_t const*, = wchar_t const*, wchar_t const*, wchar_t const*) const': > --- all_subdir_clang --- > = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x88a8): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) > = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x899c): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_transform(wchar_t = const*, wchar_t const*) const': > = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x8b34): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate::do_transform(char const*, char = const*) const': > = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text._ZNKSt3__17= collateIcE12do_transformEPKcS3_[_ZNKSt3__17collateIcE12do_transformEPKcS3_= ]+0x34): relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate::do_transform(wchar_t const*, = wchar_t const*) const': > = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text._ZNKSt3__17= collateIwE12do_transformEPKwS3_[_ZNKSt3__17collateIwE12do_transformEPKwS3_= ]+0x38): relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::num_put > = >::do_put(std::__1::ostreambuf_iterator >, std::__1::ios_base&, char, long) const': > = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text._ZNKSt3__17= num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8= ios_baseEcl[_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traits= IcEEEEE6do_putES4_RNS_8ios_baseEcl]+0x16c): additional relocation = overflows omitted from the output Ian's/Andy's original patch is listed below for reference. > Index: lib/clang/clang.lib.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- lib/clang/clang.lib.mk (revision 293584) > +++ lib/clang/clang.lib.mk (working copy) > @@ -6,4 +6,8 @@ LLVM_SRCS=3D ${.CURDIR}/../../../contrib/llvm >=20 > INTERNALLIB=3D >=20 > +.if ${MACHINE_CPUARCH} =3D=3D "arm" > +STATIC_CXXFLAGS+=3D-mlong-calls > +.endif > + > .include > Index: lib/csu/arm/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- lib/csu/arm/Makefile (revision 293584) > +++ lib/csu/arm/Makefile (working copy) > @@ -23,7 +23,7 @@ CLEANFILES+=3D crt1.s gcrt1.s Scrt1.s > # directly compiled to .o files. >=20 > crt1.s: crt1.c > - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c > + ${CC} ${CFLAGS} -mlong-calls -S -o ${.TARGET} ${.CURDIR}/crt1.c > sed ${SED_FIX_NOTE} ${.TARGET} >=20 > crt1.o: crt1.s > @@ -30,7 +30,7 @@ crt1.o: crt1.s > ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s >=20 > gcrt1.s: crt1.c > - ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c > + ${CC} ${CFLAGS} -mlong-calls -DGCRT -S -o ${.TARGET} = ${.CURDIR}/crt1.c > sed ${SED_FIX_NOTE} ${.TARGET} >=20 > gcrt1.o: gcrt1.s > Index: usr.bin/clang/clang/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- usr.bin/clang/clang/Makefile (revision 293584) > +++ usr.bin/clang/clang/Makefile (working copy) > @@ -11,7 +11,11 @@ SRCS=3D cc1_main.cpp \ >=20 > .if ${MK_SHARED_TOOLCHAIN} =3D=3D "no" > NO_SHARED?=3D yes > + > +.if ${MACHINE_CPUARCH} =3D=3D "arm" > +CFLAGS+=3D-mlong-calls > .endif > +.endif >=20 > LINKS=3D ${BINDIR}/clang ${BINDIR}/clang++ \ > ${BINDIR}/clang ${BINDIR}/clang-cpp >=20 From owner-freebsd-toolchain@freebsd.org Sun Jan 10 17:59:37 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 93872A69700 for ; Sun, 10 Jan 2016 17:59:37 +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 5692114D9 for ; Sun, 10 Jan 2016 17:59:36 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 17449 invoked from network); 10 Jan 2016 17:59:44 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 10 Jan 2016 17:59:44 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Sun, 10 Jan 2016 12:59:32 -0500 (EST) Received: (qmail 12455 invoked from network); 10 Jan 2016 17:59:32 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 10 Jan 2016 17:59:32 -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 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 ABCC51C43DB; Sun, 10 Jan 2016 09:59:31 -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: <831D8A96-51D6-4E34-B422-A20857B6769E@dsl-only.net> Date: Sun, 10 Jan 2016 09:59:33 -0800 Cc: freebsd-arm , FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: <602C5169-40E4-4A68-9C91-214E617FC255@dsl-only.net> References: <1452020032.1320.21.camel@freebsd.org> <7EE8F65E-7485-4FA9-A136-F22090DB107F@FreeBSD.org> <92264003-CF0E-4624-A28A-8AFB7C663BFB@dsl-only.net> <39774562-F76E-41E9-85E7-ABE257B013D6@FreeBSD.org> <1452365750.1523.9.camel@freebsd.org> <831D8A96-51D6-4E34-B422-A20857B6769E@dsl-only.net> To: Dimitry Andric , Ian Lepore 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: Sun, 10 Jan 2016 17:59:37 -0000 [A top post of my so far successful experiment. . .] amd64 -> rpi2 cross build: buildworld buildkernel installkernel = installworld mergemaster delete-old then boot the result on an rpi2 = worked ( -march=3Darmv7a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp = -mno-unaligned-access used ). In order to also build lldb I used the following beyond what Ian sent = out for -mlong-calls usage: (I make no claim to have tested the lldb build.) (Tabs likely not preserved in the copy/paste operations.) > # more lib_libc++_Makfile.diff=20 > Index: /usr/src/lib/libc++/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- /usr/src/lib/libc++/Makefile (revision 293430) > +++ /usr/src/lib/libc++/Makefile (working copy) > @@ -57,6 +57,9 @@ > .endfor > =20 > WARNS=3D 0 > +.if ${MACHINE_CPUARCH} =3D=3D "arm" > +STATIC_CXXFLAGS+=3D-mlong-calls > +.endif > CFLAGS+=3D -I${HDRDIR} -I${_LIBCXXRTDIR} -nostdlib -DLIBCXXRT > .if empty(CXXFLAGS:M-std=3D*) > CXXFLAGS+=3D -std=3Dc++11 > # more usr_bin_clang_lldb_Makefile.diff=20 > Index: /usr/src/usr.bin/clang/lldb/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- /usr/src/usr.bin/clang/lldb/Makefile (revision 293430) > +++ /usr/src/usr.bin/clang/lldb/Makefile (working copy) > @@ -6,6 +6,10 @@ > =20 > LLDB_SRCS=3D${.CURDIR}/../../../contrib/llvm/tools/lldb > =20 > +.if ${MACHINE_CPUARCH} =3D=3D "arm" > +CFLAGS+=3D-mlong-calls > +.endif > + > CFLAGS+=3D -I${LLDB_SRCS}/include > CXXFLAGS+=3D -std=3Dc++11 =20 The rpi2 is now attempting buildworld buildkernel targeting itself. It = is way beyond where clang 3.7.1 crashed. The above makes no claim at investigating or addressing powerpc64 = (PowerMac G5) or powerpc (PowerMac G4/G3) yet(?). So far as I know clang = mixed with the available supporting toolchain alternatives are still = insufficient for targeting those for a WITH_LIBCPLUSPLUS=3D build. = Instead something like powerpc64-xtoolchain-gcc/powerpc64-gcc must be = used, even if clang is built. (Last I knew gcc5 variations/vintages = would reject some of the WITH_CLANG_EXTRAS=3D code --but I've not tried = based on clang 3.8.0 materials.) =3D=3D=3D Mark Millard markmi at dsl-only.net On 2016-Jan-10, at 3:55 AM, Mark Millard wrote: >=20 >=20 > On 2016-Jan-9, at 10:55 AM, Ian Lepore wrote: >>=20 >> On Sat, 2016-01-09 at 15:03 +0100, Dimitry Andric wrote: >>> On 09 Jan 2016, at 04:46, Mark Millard = wrote: >>>>=20 >>>> On 2016-Jan-7, at 2:57 PM, Dimitry Andric >>>> wrote: >>> ... >>>>> 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 >>>>=20 >>>> 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. >>>=20 >>> Yes, this is caused by too large call distances. In other words, = the >>> clang executable is getting to big to link. Apparently we need to = do >>> some tricks with -mlongcall to fix this. As I am no arm expert, I >>> welcome any patch submissions. :-) >>>=20 >>> -Dimitry >>>=20 >>=20 >> Here's the patch I got from Andy for the clang380 branch, modified = with >> Warner's suggestion to use MACHINE_CPUARCH instead of MACHINE. With >> this I can get a working arm world that will build a runnable >> helloworld.c (and .cc) on a dreamplug. (I.e., it appears clang 3.8.0 >> fixes the problem we had with clang 3.7.x where it wouldn't run at = all >> on armv4/5 systems). I have not tried compling anything complex yet. >>=20 >> -- Ian >=20 >=20 > Context: When I build I normally build lldb and the like as well, even = using WITH_CLANG_EXTRAS=3D . >=20 > In trying to get lldb to link I eventually get to the point that = libc++ is getting relocation truncations. Before getting to that I deal = with /usr/src/usr.bin/clang/lldb/Makefile to cover what is initially = reported during buildworld for lldb relocation truncations. Then with = that in place and retrying I get reports from libc++.a for a couple of = the contained .o files having relocations that are truncated (before it = reports "additional relocation overflows omitted from the output"): >=20 > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(thread.o) > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o) >=20 > (Both have messages from multiple places in each .o file.) >=20 > As far as I can tell for general use -long-calls is going to be needed = for at least some system level .a library content if the .a's are to be = used. >=20 > Which leaves me wondering if STATIC_CXXFLAGS having -mlong-calls for = arm system libraries fairly generally is appropriate for those intending = on building the arm-native clang toolchain and related material in = buildworld. (STATIC_CFLAGS too?) A significant case analysis of what = happens to currently be too far apart would be fragile as things grow = even more later. >=20 > This sort of issue may well not be limited to TARGET=3Darm contexts. >=20 > The detailed libc++.a relocation truncation complaints that I got = were: >=20 >=20 >> --- all_subdir_lldb --- >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(thread.o): In = function = `_ZNSt3__16vectorINS_4pairIPNS_18condition_variableEPNS_5mutexEEENS_18__hi= dden_allocatorIS6_EEE21__push_back_slow_pathIS6_EEvOT_': >> = /usr/src/lib/libc++/../../contrib/libc++/src/thread.cpp:(.text._ZNSt3__16v= ectorINS_4pairIPNS_18condition_variableEPNS_5mutexEEENS_18__hidden_allocat= orIS6_EEE21__push_back_slow_pathIS6_EEvOT_[_ZNSt3__16vectorINS_4pairIPNS_1= 8condition_variableEPNS_5mutexEEENS_18__hidden_allocatorIS6_EEE21__push_ba= ck_slow_pathIS6_EEvOT_]+0x30): relocation truncated to fit: R_ARM_CALL = against symbol = `std::__1::__vector_base_common::__throw_length_error() const' = defined in = .text._ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv[_ZNKS= t3__120__vector_base_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(thread.o): In = function = `_ZNSt3__16vectorIPNS_17__assoc_sub_stateENS_18__hidden_allocatorIS2_EEE21= __push_back_slow_pathIRKS2_EEvOT_': >> = /usr/src/lib/libc++/../../contrib/libc++/src/thread.cpp:(.text._ZNSt3__16v= ectorIPNS_17__assoc_sub_stateENS_18__hidden_allocatorIS2_EEE21__push_back_= slow_pathIRKS2_EEvOT_[_ZNSt3__16vectorIPNS_17__assoc_sub_stateENS_18__hidd= en_allocatorIS2_EEE21__push_back_slow_pathIRKS2_EEvOT_]+0x30): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__vector_base_common::__throw_length_error() const' = defined in = .text._ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv[_ZNKS= t3__120__vector_base_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 > . . . >> --- all_subdir_clang --- >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_compare(char const*, char = const*, char const*, char const*) const': > . . . >> --- all_subdir_clang --- >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x81ec): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) > . . . >> --- all_subdir_clang --- >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x82c0): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_transform(char const*, char = const*) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x8430): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_compare(wchar_t const*, = wchar_t const*, wchar_t const*, wchar_t const*) const': >=20 >> --- all_subdir_clang --- >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x88a8): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x899c): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_transform(wchar_t = const*, wchar_t const*) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x8b34): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate::do_transform(char const*, char = const*) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text._ZNKSt3__17= collateIcE12do_transformEPKcS3_[_ZNKSt3__17collateIcE12do_transformEPKcS3_= ]+0x34): relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate::do_transform(wchar_t const*, = wchar_t const*) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text._ZNKSt3__17= collateIwE12do_transformEPKwS3_[_ZNKSt3__17collateIwE12do_transformEPKwS3_= ]+0x38): relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::num_put > = >::do_put(std::__1::ostreambuf_iterator >, std::__1::ios_base&, char, long) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text._ZNKSt3__17= num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8= ios_baseEcl[_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traits= IcEEEEE6do_putES4_RNS_8ios_baseEcl]+0x16c): additional relocation = overflows omitted from the output >=20 >=20 > Ian's/Andy's original patch is listed below for reference. >=20 >> Index: lib/clang/clang.lib.mk >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- lib/clang/clang.lib.mk (revision 293584) >> +++ lib/clang/clang.lib.mk (working copy) >> @@ -6,4 +6,8 @@ LLVM_SRCS=3D ${.CURDIR}/../../../contrib/llvm >>=20 >> INTERNALLIB=3D >>=20 >> +.if ${MACHINE_CPUARCH} =3D=3D "arm" >> +STATIC_CXXFLAGS+=3D-mlong-calls >> +.endif >> + >> .include >> Index: lib/csu/arm/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- lib/csu/arm/Makefile (revision 293584) >> +++ lib/csu/arm/Makefile (working copy) >> @@ -23,7 +23,7 @@ CLEANFILES+=3D crt1.s gcrt1.s Scrt1.s >> # directly compiled to .o files. >>=20 >> crt1.s: crt1.c >> - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c >> + ${CC} ${CFLAGS} -mlong-calls -S -o ${.TARGET} ${.CURDIR}/crt1.c >> sed ${SED_FIX_NOTE} ${.TARGET} >>=20 >> crt1.o: crt1.s >> @@ -30,7 +30,7 @@ crt1.o: crt1.s >> ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s >>=20 >> gcrt1.s: crt1.c >> - ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c >> + ${CC} ${CFLAGS} -mlong-calls -DGCRT -S -o ${.TARGET} = ${.CURDIR}/crt1.c >> sed ${SED_FIX_NOTE} ${.TARGET} >>=20 >> gcrt1.o: gcrt1.s >> Index: usr.bin/clang/clang/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- usr.bin/clang/clang/Makefile (revision 293584) >> +++ usr.bin/clang/clang/Makefile (working copy) >> @@ -11,7 +11,11 @@ SRCS=3D cc1_main.cpp \ >>=20 >> .if ${MK_SHARED_TOOLCHAIN} =3D=3D "no" >> NO_SHARED?=3D yes >> + >> +.if ${MACHINE_CPUARCH} =3D=3D "arm" >> +CFLAGS+=3D-mlong-calls >> .endif >> +.endif >>=20 >> LINKS=3D ${BINDIR}/clang ${BINDIR}/clang++ \ >> ${BINDIR}/clang ${BINDIR}/clang-cpp >>=20 >=20 From owner-freebsd-toolchain@freebsd.org Mon Jan 11 10:51:55 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 78A28A6CF8A for ; Mon, 11 Jan 2016 10:51:55 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-4.reflexion.net [208.70.210.4]) (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 3C4011DBE for ; Mon, 11 Jan 2016 10:51:54 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 453 invoked from network); 11 Jan 2016 10:51:53 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 11 Jan 2016 10:51:53 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Mon, 11 Jan 2016 05:52:01 -0500 (EST) Received: (qmail 29419 invoked from network); 11 Jan 2016 10:52:01 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 11 Jan 2016 10:52:01 -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 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 74AEE1C43C6; Mon, 11 Jan 2016 02:51:51 -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: <602C5169-40E4-4A68-9C91-214E617FC255@dsl-only.net> Date: Mon, 11 Jan 2016 02:51:51 -0800 Cc: freebsd-arm , FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: <85A38C85-27C5-4998-B680-208441932563@dsl-only.net> References: <1452020032.1320.21.camel@freebsd.org> <7EE8F65E-7485-4FA9-A136-F22090DB107F@FreeBSD.org> <92264003-CF0E-4624-A28A-8AFB7C663BFB@dsl-only.net> <39774562-F76E-41E9-85E7-ABE257B013D6@FreeBSD.org> <1452365750.1523.9.camel@freebsd.org> <831D8A96-51D6-4E34-B422-A20857B6769E@dsl-only.net> <602C5169-40E4-4A68-9C91-214E617FC255@dsl-only.net> To: Dimitry Andric , Ian Lepore 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: Mon, 11 Jan 2016 10:51:55 -0000 On 2016-Jan-10, at 9:59 AM, Mark Millard wrote: >=20 > [A top post of my so far successful experiment. . .] >=20 > amd64 -> rpi2 cross build: buildworld buildkernel installkernel = installworld mergemaster delete-old then boot the result on an rpi2 = worked ( -march=3Darmv7a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp = -mno-unaligned-access used ). >=20 > In order to also build lldb I used the following beyond what Ian sent = out for -mlong-calls usage: > (I make no claim to have tested the lldb build.) > (Tabs likely not preserved in the copy/paste operations.) >=20 >> # more lib_libc++_Makfile.diff=20 >> Index: /usr/src/lib/libc++/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- /usr/src/lib/libc++/Makefile (revision 293430) >> +++ /usr/src/lib/libc++/Makefile (working copy) >> @@ -57,6 +57,9 @@ >> .endfor >>=20 >> WARNS=3D 0 >> +.if ${MACHINE_CPUARCH} =3D=3D "arm" >> +STATIC_CXXFLAGS+=3D-mlong-calls >> +.endif >> CFLAGS+=3D -I${HDRDIR} -I${_LIBCXXRTDIR} -nostdlib -DLIBCXXRT >> .if empty(CXXFLAGS:M-std=3D*) >> CXXFLAGS+=3D -std=3Dc++11 >=20 >> # more usr_bin_clang_lldb_Makefile.diff=20 >> Index: /usr/src/usr.bin/clang/lldb/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- /usr/src/usr.bin/clang/lldb/Makefile (revision 293430) >> +++ /usr/src/usr.bin/clang/lldb/Makefile (working copy) >> @@ -6,6 +6,10 @@ >>=20 >> LLDB_SRCS=3D${.CURDIR}/../../../contrib/llvm/tools/lldb >>=20 >> +.if ${MACHINE_CPUARCH} =3D=3D "arm" >> +CFLAGS+=3D-mlong-calls >> +.endif >> + >> CFLAGS+=3D -I${LLDB_SRCS}/include >> CXXFLAGS+=3D -std=3Dc++11 >=20 >=20 >=20 > The rpi2 is now attempting buildworld buildkernel targeting itself. It = is way beyond where clang 3.7.1 crashed. The rpi2 finished buildworld buildkernel. To build: > WITH_FAST_DEPEND=3D > WITH_LIBCPLUSPLUS=3D > WITH_BINUTILS_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_ELFTOOLCHAIN_BOOTSTRAP=3D > WITHOUT_CLANG_BOOTSTRAP=3D > WITHOUT_GCC_BOOTSTRAP=3D > WITHOUT_LIB32=3D > WITHOUT_GCC=3D > WITHOUT_GNUCXX=3D > # > NO_WERROR=3D > MALLOC_PRODUCTION=3D > # > WITH_DEBUG=3D > WITH_DEBUG_FILES=3D based on -target armv6--freebsd11.0-gnueabi -march=3Darmv7a = -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp -mno-unaligned-access it took the = rpi2 14 hours 26 min or so. Then: installkernel; install world; shutdown -r now . . . . . . It boots and operates as hoped. For this rpi2 context clang 3.8.0 = seems to be working fine for such activity. > # freebsd-version -ku; uname -aKU > 11.0-CURRENT > 11.0-CURRENT > FreeBSD rpi2 11.0-CURRENT FreeBSD 11.0-CURRENT #2 r293579M: Mon Jan 11 = 07:36:21 UTC 2016 = markmi@rpi2:/usr/obj/clang/arm.armv6/usr/src/sys/RPI2-NODBG arm 1100093 = 1100093 > make.conf empty. src.conf (make.conf empty): > TO_TYPE=3Darmv6 > # > 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_BINUTILS_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_ELFTOOLCHAIN_BOOTSTRAP=3D > WITHOUT_CLANG_BOOTSTRAP=3D > WITHOUT_GCC_BOOTSTRAP=3D > WITHOUT_LIB32=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 -mfloat-abi=3Dsoftfp = -mno-unaligned-access > XCXX=3D/usr/bin/clang++ -v -target ${TO_TYPE}--freebsd11.0-gnueabi = -march=3Darmv7a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp = -mno-unaligned-access > XCPP=3D/usr/bin/clang-cpp -v -target ${TO_TYPE}--freebsd11.0-gnueabi = -march=3Darmv7a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp = -mno-unaligned-access > .export XCC > .export XCXX > .export XCPP > .endif > # > .if ${.MAKE.LEVEL} =3D=3D 0 > CC=3D/usr/bin/clang -v -march=3Darmv7a -mcpu=3Dcortex-a7 = -mfloat-abi=3Dsoftfp -mno-unaligned-access > CXX=3D/usr/bin/clang++ -v -march=3Darmv7a -mcpu=3Dcortex-a7 = -mfloat-abi=3Dsoftfp -mno-unaligned-access > CPP=3D/usr/bin/clang-cpp -v -march=3Darmv7a -mcpu=3Dcortex-a7 = -mfloat-abi=3Dsoftfp -mno-unaligned-access > .export CC > .export CXX > .export CPP > .endif This vintage of src.conf presumes Ian Lepore's updates to the system's = binutils that allow them to handle armv7a movt instruction usage and the = like. RPI2-NODBG: > ident RPI2-NODBG >=20 > include "RPI2" >=20 > makeoptions DEBUG=3D-g # Build kernel with gdb(1) = debug symbols > options ALT_BREAK_TO_DEBUGGER > #options VERBOSE_SYSINIT # Enable verbose sysinit = messages >=20 > options KDB # Enable kernel debugger = support >=20 > # For minimum debugger support (stable branch) use: > #options KDB_TRACE # Print a stack trace for a = panic > options DDB # Enable the kernel debugger >=20 > nooptions INVARIANTS # Enable calls of extra sanity = checking > nooptions INVARIANT_SUPPORT # Extra sanity checks of = internal structures, required by INVARIANTS > nooptions WITNESS # Enable checks to detect = deadlocks and cycles > nooptions WITNESS_SKIPSPIN # Don't run witness on = spinlocks for speed > nooptions DIAGNOSTIC Where I've got somewhat variant source code is listed below: (This includes the recent changes to various Makefiles for arm = -mlong-call use for clang 3.8.0 .) > # svnlite status /usr/src/ > M /usr/src/contrib/libcxxrt/guard.cc > M /usr/src/lib/clang/clang.lib.mk > M /usr/src/lib/csu/arm/Makefile > M /usr/src/lib/csu/powerpc64/Makefile > M /usr/src/lib/libc++/Makefile > ? /usr/src/sys/arm/conf/RPI2-NODBG > M /usr/src/sys/boot/ofw/Makefile.inc > M /usr/src/sys/boot/powerpc/Makefile.inc > M /usr/src/sys/boot/uboot/Makefile.inc > ? /usr/src/sys/powerpc/conf/GENERIC64vtsc > ? /usr/src/sys/powerpc/conf/GENERIC64vtsc-NODEBUG > ? /usr/src/sys/powerpc/conf/GENERICvtsc > ? /usr/src/sys/powerpc/conf/GENERICvtsc-NODEBUG > M /usr/src/sys/powerpc/ofw/ofw_machdep.c > M /usr/src/usr.bin/clang/clang/Makefile > M /usr/src/usr.bin/clang/lldb/Makefile (Most of the above is powerpc64 or powerpc specific, some even PowerMac = G5 specific.) Confirming that lldb does something: > # more main.c > int > main () > { > return 0; > } > # clang main.c > # lldb a.out > (lldb) target create "a.out" > Current executable set to 'a.out' (arm). > (lldb) run > Process 744 launching > Process 744 launched: '/root/c_tests/a.out' (arm) > Process 744 exited with status =3D 0 (0x00000000)=20 > (lldb) quit So the 2 additional Makefiles with -mlong-calls usage for arm was = sufficient. It does look like that for -march=3Darmv7a there will be an issue of = needing more use of -fpic/-fPIC and the like in ports. Otherwise things = like "unresolvable R_ARM_MOVW_ABS_NC relocation against symbol `g_free'" = tend to occur in producing -Bsharable files. For -march=3Darmv7a -mcpu=3Dcortex-a7 there is the example of = .libs/gdkcairo.o being rejected with that message: > /bin/sh ../libtool --tag=3DCC --mode=3Dlink /usr/bin/clang -v = -target armv6--freebsd11.0-gnueabi -march=3Darmv7-a -mcpu=3Dcortex-a7 = -mfloat-abi=3Dsoftfp -mno-unaligned-access -pipe -mfloat-abi=3Dsoftfp = -g -fno-strict-aliasing -Wall -version-info 2400:29:2400 = -export-dynamic -rpath /usr/local/lib -export-symbols-regex "^[^_].*" = -L/usr/local/lib -o libgdk-x11-2.0.la gdk.lo gdkapplaunchcontext.lo = gdkcairo.lo gdkcolor.lo gdkcursor.lo gdkdisplay.lo gdkdisplaymanager.lo = gdkdnd.lo gdkdraw.lo gdkevents.lo gdkfont.lo gdkgc.lo gdkglobals.lo = gdkimage.lo gdkkeys.lo gdkkeyuni.lo gdkoffscreenwindow.lo gdkpango.lo = gdkpixbuf-drawable.lo gdkpixbuf-render.lo gdkpixmap.lo = gdkpolyreg-generic.lo gdkrectangle.lo gdkregion-generic.lo gdkrgb.lo = gdkscreen.lo gdkselection.lo gdkvisual.lo gdkwindow.lo gdkwindowimpl.lo = gdkenumtypes.lo gdkmarshalers.lo x11/libgdk-x11.la -L/usr/local/lib = -lpangocairo-1.0 -lpango-1.0 -lgio-2.0 -lfontconfig -lfreetype -lXrender = -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lXfixes = -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo -lpthread -lX11 = -lXext -lm . . . > libtool: link: /usr/bin/clang -v -target armv6--freebsd11.0-gnueabi = -march=3Darmv7-a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp = -mno-unaligned-access -shared .libs/gdk.o .libs/gdkapplaunchcontext.o = .libs/gdkcairo.o .libs/gdkcolor.o .libs/gdkcursor.o .libs/gdkdisplay.o = .libs/gdkdisplaymanager.o .libs/gdkdnd.o .libs/gdkdraw.o = .libs/gdkevents.o .libs/gdkfont.o .libs/gdkgc.o .libs/gdkglobals.o = .libs/gdkimage.o .libs/gdkkeys.o .libs/gdkkeyuni.o = .libs/gdkoffscreenwindow.o .libs/gdkpango.o .libs/gdkpixbuf-drawable.o = .libs/gdkpixbuf-render.o .libs/gdkpixmap.o .libs/gdkpolyreg-generic.o = .libs/gdkrectangle.o .libs/gdkregion-generic.o .libs/gdkrgb.o = .libs/gdkscreen.o .libs/gdkselection.o .libs/gdkvisual.o = .libs/gdkwindow.o .libs/gdkwindowimpl.o .libs/gdkenumtypes.o = .libs/gdkmarshalers.o -Wl,--whole-archive x11/.libs/libgdk-x11.a = -Wl,--no-whole-archive -L/usr/local/lib -lpangocairo-1.0 -lpango-1.0 = -lgio-2.0 -lfontconfig -lfreetype -lXrender -lXinerama -lXi -lXrandr = -lXcursor -lXcomposite -lXdamage -lXfixes -lgdk_pixbuf-2.0 -lgobject-2.0 = -lglib-2.0 -lintl -lcairo -lpthread -lX11 -lXext -lm -march=3Darmv7-a = -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp -mno-unaligned-access = -mfloat-abi=3Dsoftfp -g -Wl,-soname -Wl,libgdk-x11-2.0.so.0 = -Wl,-version-script -Wl,.libs/libgdk-x11-2.0.so.0.2400.29-ver -o = .libs/libgdk-x11-2.0.so.0.2400.29 > 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/bin/ld" --eh-frame-hdr -Bshareable --hash-style=3Dboth = --enable-new-dtags -o .libs/libgdk-x11-2.0.so.0.2400.29 /usr/lib/crti.o = /usr/lib/crtbeginS.o -L/usr/local/lib -L/usr/lib .libs/gdk.o = .libs/gdkapplaunchcontext.o .libs/gdkcairo.o .libs/gdkcolor.o = .libs/gdkcursor.o .libs/gdkdisplay.o .libs/gdkdisplaymanager.o = .libs/gdkdnd.o .libs/gdkdraw.o .libs/gdkevents.o .libs/gdkfont.o = .libs/gdkgc.o .libs/gdkglobals.o .libs/gdkimage.o .libs/gdkkeys.o = .libs/gdkkeyuni.o .libs/gdkoffscreenwindow.o .libs/gdkpango.o = .libs/gdkpixbuf-drawable.o .libs/gdkpixbuf-render.o .libs/gdkpixmap.o = .libs/gdkpolyreg-generic.o .libs/gdkrectangle.o = .libs/gdkregion-generic.o .libs/gdkrgb.o .libs/gdkscreen.o = .libs/gdkselection.o .libs/gdkvisual.o .libs/gdkwindow.o = .libs/gdkwindowimpl.o .libs/gdkenumtypes.o .libs/gdkmarshalers.o = --whole-archive x11/.libs/libgdk-x11.a --no-whole-archive = -lpangocairo-1.0 -lpango-1.0 -lgio-2.0 -lfontconfig -lfreetype -lXrender = -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lXfixes = -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo -lpthread -lX11 = -lXext -lm -soname libgdk-x11-2.0.so.0 -version-script = .libs/libgdk-x11-2.0.so.0.2400.29-ver -lgcc --as-needed -lgcc_s = --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed = /usr/lib/crtendS.o /usr/lib/crtn.o > /usr/bin/ld: .libs/gdkcairo.o(.text+0x61c): unresolvable = R_ARM_MOVW_ABS_NC relocation against symbol `g_free' > /usr/bin/ld: final link failed: Nonrepresentable section on output > clang: error: linker command failed with exit code 1 (use -v to see = invocation) > Makefile:1098: recipe for target 'libgdk-x11-2.0.la' failed > gmake[6]: *** [libgdk-x11-2.0.la] Error 1 > gmake[6]: Leaving directory = '/usr/obj/portswork/usr/ports/x11-toolkits/gtk20/work/gtk+-2.24.29/gdk' > Makefile:1238: recipe for target 'all-recursive' failed > gmake[5]: *** [all-recursive] Error 1 > gmake[5]: Leaving directory = '/usr/obj/portswork/usr/ports/x11-toolkits/gtk20/work/gtk+-2.24.29/gdk' > Makefile:1018: recipe for target 'all' failed > gmake[4]: *** [all] Error 2 > gmake[4]: Leaving directory = '/usr/obj/portswork/usr/ports/x11-toolkits/gtk20/work/gtk+-2.24.29/gdk' > Makefile:729: recipe for target 'all-recursive' failed > gmake[3]: *** [all-recursive] Error 1 > gmake[3]: Leaving directory = '/usr/obj/portswork/usr/ports/x11-toolkits/gtk20/work/gtk+-2.24.29' > Makefile:621: recipe for target 'all' failed > gmake[2]: *** [all] Error 2 > gmake[2]: Leaving directory = '/usr/obj/portswork/usr/ports/x11-toolkits/gtk20/work/gtk+-2.24.29' > =3D=3D=3D> Compilation failed unexpectedly. > Try to set MAKE_JOBS_UNSAFE=3Dyes and rebuild before reporting the = failure to > the maintainer. > *** Error code 1 Where the prior activity to produce .libs/gdkcairo.o was: > /bin/sh ../libtool --tag=3DCC --mode=3Dcompile /usr/bin/clang -v = -target armv6--freebsd11.0-gnueabi -march=3Darmv7-a -mcpu=3Dcortex-a7 = -mfloat-abi=3Dsoftfp -mno-unaligned-access -DHAVE_CONFIG_H -I. -I.. = -DG_LOG_DOMAIN=3D\"Gdk\" -DGDK_COMPILATION -I.. -I.. -I../gdk = -DG_DISABLE_CAST_CHECKS -I/usr/local/include/glib-2.0 = -I/usr/local/lib/glib-2.0/include -I/usr/local/include = -I/usr/local/include/pango-1.0 -I/usr/local/include/cairo = -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 = -I/usr/local/include/libdrm -I/usr/local/include/libpng16 = -I/usr/local/include/gio-unix-2.0/ -I/usr/local/include/gdk-pixbuf-2.0 = -pthread -D_THREAD_SAFE -I/usr/local/include = -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES = -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES = -I/usr/local/include -D_THREAD_SAFE -pipe -mfloat-abi=3Dsoftfp -g = -fno-strict-aliasing -Wall -MT gdkcairo.lo -MD -MP -MF = .deps/gdkcairo.Tpo -c -o gdkcairo.lo gdkcairo.c . . . > "/usr/bin/clang" -cc1 -triple armv7--freebsd11.0-gnueabi -emit-obj = -mrelax-all -disable-free -main-file-name gdkcairo.c -mrelocation-model = static -mthread-model posix -mdisable-fp-elim -relaxed-alias > ing -masm-verbose -mconstructor-aliases -target-cpu cortex-a7 = -target-feature +soft-float-abi -target-feature +strict-align = -target-abi aapcs-linux -mfloat-abi soft -v -dwarf-column-info = -debug-info-k > ind=3Dstandalone -dwarf-version=3D2 -debugger-tuning=3Dgdb = -coverage-file = /usr/obj/portswork/usr/ports/x11-toolkits/gtk20/work/gtk+-2.24.29/gdk/gdkc= airo.c -resource-dir /usr/bin/../lib/clang/3.8.0 -dependen > cy-file .deps/gdkcairo.Tpo -sys-header-deps -MP -MT gdkcairo.lo -D = HAVE_CONFIG_H -I . -I .. -D "G_LOG_DOMAIN=3D\"Gdk\"" -D GDK_COMPILATION = -I .. -I .. -I ../gdk -D G_DISABLE_CAST_CHECKS -I /usr/local/in > clude/glib-2.0 -I /usr/local/lib/glib-2.0/include -I = /usr/local/include -I /usr/local/include/pango-1.0 -I = /usr/local/include/cairo -I /usr/local/include/pixman-1 -I = /usr/local/include/freetype2 -I /u > sr/local/include/libdrm -I /usr/local/include/libpng16 -I = /usr/local/include/gio-unix-2.0/ -I /usr/local/include/gdk-pixbuf-2.0 -D = _THREAD_SAFE -I /usr/local/include -D G_DISABLE_SINGLE_INCLUDES -D AT > K_DISABLE_SINGLE_INCLUDES -D GDK_PIXBUF_DISABLE_SINGLE_INCLUDES -D = GTK_DISABLE_SINGLE_INCLUDES -I /usr/local/include -D _THREAD_SAFE -Wall = -fdebug-compilation-dir /usr/obj/portswork/usr/ports/x11-tool > kits/gtk20/work/gtk+-2.24.29/gdk -ferror-limit 19 -fmessage-length 200 = -pthread -fallow-half-arguments-and-returns -fno-signed-char = -fobjc-runtime=3Dgnustep -fdiagnostics-show-option -fcolor-diagnostics > -o gdkcairo.o -x c gdkcairo.c . . . > libtool: compile: mv -f "gdkcairo.o" ".libs/gdkcairo.o" =3D=3D=3D Mark Millard markmi at dsl-only.net On 2016-Jan-10, at 3:55 AM, Mark Millard wrote: >=20 >=20 > On 2016-Jan-9, at 10:55 AM, Ian Lepore wrote: >>=20 >> On Sat, 2016-01-09 at 15:03 +0100, Dimitry Andric wrote: >>> On 09 Jan 2016, at 04:46, Mark Millard = wrote: >>>>=20 >>>> On 2016-Jan-7, at 2:57 PM, Dimitry Andric >>>> wrote: >>> ... >>>>> 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 >>>>=20 >>>> 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. >>>=20 >>> Yes, this is caused by too large call distances. In other words, = the >>> clang executable is getting to big to link. Apparently we need to = do >>> some tricks with -mlongcall to fix this. As I am no arm expert, I >>> welcome any patch submissions. :-) >>>=20 >>> -Dimitry >>>=20 >>=20 >> Here's the patch I got from Andy for the clang380 branch, modified = with >> Warner's suggestion to use MACHINE_CPUARCH instead of MACHINE. With >> this I can get a working arm world that will build a runnable >> helloworld.c (and .cc) on a dreamplug. (I.e., it appears clang 3.8.0 >> fixes the problem we had with clang 3.7.x where it wouldn't run at = all >> on armv4/5 systems). I have not tried compling anything complex yet. >>=20 >> -- Ian >=20 >=20 > Context: When I build I normally build lldb and the like as well, even = using WITH_CLANG_EXTRAS=3D . >=20 > In trying to get lldb to link I eventually get to the point that = libc++ is getting relocation truncations. Before getting to that I deal = with /usr/src/usr.bin/clang/lldb/Makefile to cover what is initially = reported during buildworld for lldb relocation truncations. Then with = that in place and retrying I get reports from libc++.a for a couple of = the contained .o files having relocations that are truncated (before it = reports "additional relocation overflows omitted from the output"): >=20 > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(thread.o) > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o) >=20 > (Both have messages from multiple places in each .o file.) >=20 > As far as I can tell for general use -long-calls is going to be needed = for at least some system level .a library content if the .a's are to be = used. >=20 > Which leaves me wondering if STATIC_CXXFLAGS having -mlong-calls for = arm system libraries fairly generally is appropriate for those intending = on building the arm-native clang toolchain and related material in = buildworld. (STATIC_CFLAGS too?) A significant case analysis of what = happens to currently be too far apart would be fragile as things grow = even more later. >=20 > This sort of issue may well not be limited to TARGET=3Darm contexts. >=20 > The detailed libc++.a relocation truncation complaints that I got = were: >=20 >=20 >> --- all_subdir_lldb --- >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(thread.o): In = function = `_ZNSt3__16vectorINS_4pairIPNS_18condition_variableEPNS_5mutexEEENS_18__hi= dden_allocatorIS6_EEE21__push_back_slow_pathIS6_EEvOT_': >> = /usr/src/lib/libc++/../../contrib/libc++/src/thread.cpp:(.text._ZNSt3__16v= ectorINS_4pairIPNS_18condition_variableEPNS_5mutexEEENS_18__hidden_allocat= orIS6_EEE21__push_back_slow_pathIS6_EEvOT_[_ZNSt3__16vectorINS_4pairIPNS_1= 8condition_variableEPNS_5mutexEEENS_18__hidden_allocatorIS6_EEE21__push_ba= ck_slow_pathIS6_EEvOT_]+0x30): relocation truncated to fit: R_ARM_CALL = against symbol = `std::__1::__vector_base_common::__throw_length_error() const' = defined in = .text._ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv[_ZNKS= t3__120__vector_base_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(thread.o): In = function = `_ZNSt3__16vectorIPNS_17__assoc_sub_stateENS_18__hidden_allocatorIS2_EEE21= __push_back_slow_pathIRKS2_EEvOT_': >> = /usr/src/lib/libc++/../../contrib/libc++/src/thread.cpp:(.text._ZNSt3__16v= ectorIPNS_17__assoc_sub_stateENS_18__hidden_allocatorIS2_EEE21__push_back_= slow_pathIRKS2_EEvOT_[_ZNSt3__16vectorIPNS_17__assoc_sub_stateENS_18__hidd= en_allocatorIS2_EEE21__push_back_slow_pathIRKS2_EEvOT_]+0x30): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__vector_base_common::__throw_length_error() const' = defined in = .text._ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv[_ZNKS= t3__120__vector_base_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 > . . . >> --- all_subdir_clang --- >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_compare(char const*, char = const*, char const*, char const*) const': > . . . >> --- all_subdir_clang --- >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x81ec): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) > . . . >> --- all_subdir_clang --- >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x82c0): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_transform(char const*, char = const*) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x8430): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_compare(wchar_t const*, = wchar_t const*, wchar_t const*, wchar_t const*) const': >=20 >> --- all_subdir_clang --- >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x88a8): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x899c): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_transform(wchar_t = const*, wchar_t const*) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x8b34): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate::do_transform(char const*, char = const*) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text._ZNKSt3__17= collateIcE12do_transformEPKcS3_[_ZNKSt3__17collateIcE12do_transformEPKcS3_= ]+0x34): relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate::do_transform(wchar_t const*, = wchar_t const*) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text._ZNKSt3__17= collateIwE12do_transformEPKwS3_[_ZNKSt3__17collateIwE12do_transformEPKwS3_= ]+0x38): relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::num_put > = >::do_put(std::__1::ostreambuf_iterator >, std::__1::ios_base&, char, long) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text._ZNKSt3__17= num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8= ios_baseEcl[_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traits= IcEEEEE6do_putES4_RNS_8ios_baseEcl]+0x16c): additional relocation = overflows omitted from the output >=20 >=20 > Ian's/Andy's original patch is listed below for reference. >=20 >> Index: lib/clang/clang.lib.mk >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- lib/clang/clang.lib.mk (revision 293584) >> +++ lib/clang/clang.lib.mk (working copy) >> @@ -6,4 +6,8 @@ LLVM_SRCS=3D ${.CURDIR}/../../../contrib/llvm >>=20 >> INTERNALLIB=3D >>=20 >> +.if ${MACHINE_CPUARCH} =3D=3D "arm" >> +STATIC_CXXFLAGS+=3D-mlong-calls >> +.endif >> + >> .include >> Index: lib/csu/arm/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- lib/csu/arm/Makefile (revision 293584) >> +++ lib/csu/arm/Makefile (working copy) >> @@ -23,7 +23,7 @@ CLEANFILES+=3D crt1.s gcrt1.s Scrt1.s >> # directly compiled to .o files. >>=20 >> crt1.s: crt1.c >> - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c >> + ${CC} ${CFLAGS} -mlong-calls -S -o ${.TARGET} ${.CURDIR}/crt1.c >> sed ${SED_FIX_NOTE} ${.TARGET} >>=20 >> crt1.o: crt1.s >> @@ -30,7 +30,7 @@ crt1.o: crt1.s >> ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s >>=20 >> gcrt1.s: crt1.c >> - ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c >> + ${CC} ${CFLAGS} -mlong-calls -DGCRT -S -o ${.TARGET} = ${.CURDIR}/crt1.c >> sed ${SED_FIX_NOTE} ${.TARGET} >>=20 >> gcrt1.o: gcrt1.s >> Index: usr.bin/clang/clang/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- usr.bin/clang/clang/Makefile (revision 293584) >> +++ usr.bin/clang/clang/Makefile (working copy) >> @@ -11,7 +11,11 @@ SRCS=3D cc1_main.cpp \ >>=20 >> .if ${MK_SHARED_TOOLCHAIN} =3D=3D "no" >> NO_SHARED?=3D yes >> + >> +.if ${MACHINE_CPUARCH} =3D=3D "arm" >> +CFLAGS+=3D-mlong-calls >> .endif >> +.endif >>=20 >> LINKS=3D ${BINDIR}/clang ${BINDIR}/clang++ \ >> ${BINDIR}/clang ${BINDIR}/clang-cpp >>=20 >=20 From owner-freebsd-toolchain@freebsd.org Mon Jan 11 12:56:08 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 D4D38A692AB for ; Mon, 11 Jan 2016 12:56:08 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-4.reflexion.net [208.70.210.4]) (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 7479C1EC4 for ; Mon, 11 Jan 2016 12:56:07 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 11544 invoked from network); 11 Jan 2016 12:56:11 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 11 Jan 2016 12:56:11 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Mon, 11 Jan 2016 07:56:09 -0500 (EST) Received: (qmail 21846 invoked from network); 11 Jan 2016 12:56:09 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 11 Jan 2016 12:56:09 -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 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 233011C43C6; Mon, 11 Jan 2016 04:55:59 -0800 (PST) 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: <85A38C85-27C5-4998-B680-208441932563@dsl-only.net> Date: Mon, 11 Jan 2016 04:56:00 -0800 Cc: freebsd-arm , FreeBSD Toolchain Message-Id: References: <1452020032.1320.21.camel@freebsd.org> <7EE8F65E-7485-4FA9-A136-F22090DB107F@FreeBSD.org> <92264003-CF0E-4624-A28A-8AFB7C663BFB@dsl-only.net> <39774562-F76E-41E9-85E7-ABE257B013D6@FreeBSD.org> <1452365750.1523.9.camel@freebsd.org> <831D8A96-51D6-4E34-B422-A20857B6769E@dsl-only.net> <602C5169-40E4-4A68-9C91-214E617FC255@dsl-only.net> <85A38C85-27C5-4998-B680-208441932563@dsl-only.net> To: Dimitry Andric , Ian Lepore X-Mailer: Apple Mail (2.2104) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Mon, 11 Jan 2016 12:56:09 -0000 Quick top post of a correction to a mistake of mine about the ports = issue: The notes about -fpic/-fPIC issues with ports are wrong and the issue = was self inflicted: using -v on the clang or clang++ command lines = messes up autoconf/libtool by them not handling the extra output text = well. Many ports depend on those tools. =3D=3D=3D Mark Millard markmi at dsl-only.net On 2016-Jan-11, at 2:51 AM, Mark Millard wrote: >=20 >=20 > On 2016-Jan-10, at 9:59 AM, Mark Millard = wrote: >>=20 >> [A top post of my so far successful experiment. . .] >>=20 >> amd64 -> rpi2 cross build: buildworld buildkernel installkernel = installworld mergemaster delete-old then boot the result on an rpi2 = worked ( -march=3Darmv7a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp = -mno-unaligned-access used ). >>=20 >> In order to also build lldb I used the following beyond what Ian sent = out for -mlong-calls usage: >> (I make no claim to have tested the lldb build.) >> (Tabs likely not preserved in the copy/paste operations.) >>=20 >>> # more lib_libc++_Makfile.diff=20 >>> Index: /usr/src/lib/libc++/Makefile >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> --- /usr/src/lib/libc++/Makefile (revision 293430) >>> +++ /usr/src/lib/libc++/Makefile (working copy) >>> @@ -57,6 +57,9 @@ >>> .endfor >>>=20 >>> WARNS=3D 0 >>> +.if ${MACHINE_CPUARCH} =3D=3D "arm" >>> +STATIC_CXXFLAGS+=3D-mlong-calls >>> +.endif >>> CFLAGS+=3D -I${HDRDIR} -I${_LIBCXXRTDIR} -nostdlib -DLIBCXXRT >>> .if empty(CXXFLAGS:M-std=3D*) >>> CXXFLAGS+=3D -std=3Dc++11 >>=20 >>> # more usr_bin_clang_lldb_Makefile.diff=20 >>> Index: /usr/src/usr.bin/clang/lldb/Makefile >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> --- /usr/src/usr.bin/clang/lldb/Makefile (revision 293430) >>> +++ /usr/src/usr.bin/clang/lldb/Makefile (working copy) >>> @@ -6,6 +6,10 @@ >>>=20 >>> LLDB_SRCS=3D${.CURDIR}/../../../contrib/llvm/tools/lldb >>>=20 >>> +.if ${MACHINE_CPUARCH} =3D=3D "arm" >>> +CFLAGS+=3D-mlong-calls >>> +.endif >>> + >>> CFLAGS+=3D -I${LLDB_SRCS}/include >>> CXXFLAGS+=3D -std=3Dc++11 >>=20 >>=20 >>=20 >> The rpi2 is now attempting buildworld buildkernel targeting itself. = It is way beyond where clang 3.7.1 crashed. >=20 >=20 >=20 > The rpi2 finished buildworld buildkernel. To build: >=20 >> WITH_FAST_DEPEND=3D >> WITH_LIBCPLUSPLUS=3D >> WITH_BINUTILS_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_ELFTOOLCHAIN_BOOTSTRAP=3D >> WITHOUT_CLANG_BOOTSTRAP=3D >> WITHOUT_GCC_BOOTSTRAP=3D >> WITHOUT_LIB32=3D >> WITHOUT_GCC=3D >> WITHOUT_GNUCXX=3D >> # >> NO_WERROR=3D >> MALLOC_PRODUCTION=3D >> # >> WITH_DEBUG=3D >> WITH_DEBUG_FILES=3D >=20 > based on -target armv6--freebsd11.0-gnueabi -march=3Darmv7a = -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp -mno-unaligned-access it took the = rpi2 14 hours 26 min or so. >=20 > Then: installkernel; install world; shutdown -r now . . . >=20 > . . . It boots and operates as hoped. For this rpi2 context clang = 3.8.0 seems to be working fine for such activity. >=20 >> # freebsd-version -ku; uname -aKU >> 11.0-CURRENT >> 11.0-CURRENT >> FreeBSD rpi2 11.0-CURRENT FreeBSD 11.0-CURRENT #2 r293579M: Mon Jan = 11 07:36:21 UTC 2016 = markmi@rpi2:/usr/obj/clang/arm.armv6/usr/src/sys/RPI2-NODBG arm 1100093 = 1100093 >> make.conf empty. >=20 > src.conf (make.conf empty): >=20 >> TO_TYPE=3Darmv6 >> # >> 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_BINUTILS_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_ELFTOOLCHAIN_BOOTSTRAP=3D >> WITHOUT_CLANG_BOOTSTRAP=3D >> WITHOUT_GCC_BOOTSTRAP=3D >> WITHOUT_LIB32=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 -mfloat-abi=3Dsoftfp = -mno-unaligned-access >> XCXX=3D/usr/bin/clang++ -v -target ${TO_TYPE}--freebsd11.0-gnueabi = -march=3Darmv7a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp = -mno-unaligned-access >> XCPP=3D/usr/bin/clang-cpp -v -target ${TO_TYPE}--freebsd11.0-gnueabi = -march=3Darmv7a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp = -mno-unaligned-access >> .export XCC >> .export XCXX >> .export XCPP >> .endif >> # >> .if ${.MAKE.LEVEL} =3D=3D 0 >> CC=3D/usr/bin/clang -v -march=3Darmv7a -mcpu=3Dcortex-a7 = -mfloat-abi=3Dsoftfp -mno-unaligned-access >> CXX=3D/usr/bin/clang++ -v -march=3Darmv7a -mcpu=3Dcortex-a7 = -mfloat-abi=3Dsoftfp -mno-unaligned-access >> CPP=3D/usr/bin/clang-cpp -v -march=3Darmv7a -mcpu=3Dcortex-a7 = -mfloat-abi=3Dsoftfp -mno-unaligned-access >> .export CC >> .export CXX >> .export CPP >> .endif >=20 > This vintage of src.conf presumes Ian Lepore's updates to the system's = binutils that allow them to handle armv7a movt instruction usage and the = like. >=20 >=20 > RPI2-NODBG: >=20 >> ident RPI2-NODBG >>=20 >> include "RPI2" >>=20 >> makeoptions DEBUG=3D-g # Build kernel with gdb(1) = debug symbols >> options ALT_BREAK_TO_DEBUGGER >> #options VERBOSE_SYSINIT # Enable verbose sysinit = messages >>=20 >> options KDB # Enable kernel debugger = support >>=20 >> # For minimum debugger support (stable branch) use: >> #options KDB_TRACE # Print a stack trace for a = panic >> options DDB # Enable the kernel debugger >>=20 >> nooptions INVARIANTS # Enable calls of extra = sanity checking >> nooptions INVARIANT_SUPPORT # Extra sanity checks of = internal structures, required by INVARIANTS >> nooptions WITNESS # Enable checks to detect = deadlocks and cycles >> nooptions WITNESS_SKIPSPIN # Don't run witness on = spinlocks for speed >> nooptions DIAGNOSTIC >=20 >=20 > Where I've got somewhat variant source code is listed below: > (This includes the recent changes to various Makefiles for arm = -mlong-call use for clang 3.8.0 .) >=20 >> # svnlite status /usr/src/ >> M /usr/src/contrib/libcxxrt/guard.cc >> M /usr/src/lib/clang/clang.lib.mk >> M /usr/src/lib/csu/arm/Makefile >> M /usr/src/lib/csu/powerpc64/Makefile >> M /usr/src/lib/libc++/Makefile >> ? /usr/src/sys/arm/conf/RPI2-NODBG >> M /usr/src/sys/boot/ofw/Makefile.inc >> M /usr/src/sys/boot/powerpc/Makefile.inc >> M /usr/src/sys/boot/uboot/Makefile.inc >> ? /usr/src/sys/powerpc/conf/GENERIC64vtsc >> ? /usr/src/sys/powerpc/conf/GENERIC64vtsc-NODEBUG >> ? /usr/src/sys/powerpc/conf/GENERICvtsc >> ? /usr/src/sys/powerpc/conf/GENERICvtsc-NODEBUG >> M /usr/src/sys/powerpc/ofw/ofw_machdep.c >> M /usr/src/usr.bin/clang/clang/Makefile >> M /usr/src/usr.bin/clang/lldb/Makefile >=20 > (Most of the above is powerpc64 or powerpc specific, some even = PowerMac G5 specific.) >=20 >=20 > Confirming that lldb does something: >=20 >> # more main.c >> int >> main () >> { >> return 0; >> } >> # clang main.c >> # lldb a.out >> (lldb) target create "a.out" >> Current executable set to 'a.out' (arm). >> (lldb) run >> Process 744 launching >> Process 744 launched: '/root/c_tests/a.out' (arm) >> Process 744 exited with status =3D 0 (0x00000000)=20 >> (lldb) quit >=20 > So the 2 additional Makefiles with -mlong-calls usage for arm was = sufficient. >=20 >=20 >=20 > It does look like that for -march=3Darmv7a there will be an issue of = needing more use of -fpic/-fPIC and the like in ports. Otherwise things = like "unresolvable R_ARM_MOVW_ABS_NC relocation against symbol `g_free'" = tend to occur in producing -Bsharable files. >=20 > For -march=3Darmv7a -mcpu=3Dcortex-a7 there is the example of = .libs/gdkcairo.o being rejected with that message: >=20 >> /bin/sh ../libtool --tag=3DCC --mode=3Dlink /usr/bin/clang -v = -target armv6--freebsd11.0-gnueabi -march=3Darmv7-a -mcpu=3Dcortex-a7 = -mfloat-abi=3Dsoftfp -mno-unaligned-access -pipe -mfloat-abi=3Dsoftfp = -g -fno-strict-aliasing -Wall -version-info 2400:29:2400 = -export-dynamic -rpath /usr/local/lib -export-symbols-regex "^[^_].*" = -L/usr/local/lib -o libgdk-x11-2.0.la gdk.lo gdkapplaunchcontext.lo = gdkcairo.lo gdkcolor.lo gdkcursor.lo gdkdisplay.lo gdkdisplaymanager.lo = gdkdnd.lo gdkdraw.lo gdkevents.lo gdkfont.lo gdkgc.lo gdkglobals.lo = gdkimage.lo gdkkeys.lo gdkkeyuni.lo gdkoffscreenwindow.lo gdkpango.lo = gdkpixbuf-drawable.lo gdkpixbuf-render.lo gdkpixmap.lo = gdkpolyreg-generic.lo gdkrectangle.lo gdkregion-generic.lo gdkrgb.lo = gdkscreen.lo gdkselection.lo gdkvisual.lo gdkwindow.lo gdkwindowimpl.lo = gdkenumtypes.lo gdkmarshalers.lo x11/libgdk-x11.la -L/usr/local/lib = -lpangocairo-1.0 -lpango-1.0 -lgio-2.0 -lfontconfig -lfreetype -lXrender = -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lXfixes = -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo -lpthread -lX11 = -lXext -lm > . . . >> libtool: link: /usr/bin/clang -v -target armv6--freebsd11.0-gnueabi = -march=3Darmv7-a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp = -mno-unaligned-access -shared .libs/gdk.o .libs/gdkapplaunchcontext.o = .libs/gdkcairo.o .libs/gdkcolor.o .libs/gdkcursor.o .libs/gdkdisplay.o = .libs/gdkdisplaymanager.o .libs/gdkdnd.o .libs/gdkdraw.o = .libs/gdkevents.o .libs/gdkfont.o .libs/gdkgc.o .libs/gdkglobals.o = .libs/gdkimage.o .libs/gdkkeys.o .libs/gdkkeyuni.o = .libs/gdkoffscreenwindow.o .libs/gdkpango.o .libs/gdkpixbuf-drawable.o = .libs/gdkpixbuf-render.o .libs/gdkpixmap.o .libs/gdkpolyreg-generic.o = .libs/gdkrectangle.o .libs/gdkregion-generic.o .libs/gdkrgb.o = .libs/gdkscreen.o .libs/gdkselection.o .libs/gdkvisual.o = .libs/gdkwindow.o .libs/gdkwindowimpl.o .libs/gdkenumtypes.o = .libs/gdkmarshalers.o -Wl,--whole-archive x11/.libs/libgdk-x11.a = -Wl,--no-whole-archive -L/usr/local/lib -lpangocairo-1.0 -lpango-1.0 = -lgio-2.0 -lfontconfig -lfreetype -lXrender -lXinerama -lXi -lXrandr = -lXcursor -lXcomposite -lXdamage -lXfixes -lgdk_pixbuf-2.0 -lgobject-2.0 = -lglib-2.0 -lintl -lcairo -lpthread -lX11 -lXext -lm -march=3Darmv7-a = -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp -mno-unaligned-access = -mfloat-abi=3Dsoftfp -g -Wl,-soname -Wl,libgdk-x11-2.0.so.0 = -Wl,-version-script -Wl,.libs/libgdk-x11-2.0.so.0.2400.29-ver -o = .libs/libgdk-x11-2.0.so.0.2400.29 >> 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/bin/ld" --eh-frame-hdr -Bshareable --hash-style=3Dboth = --enable-new-dtags -o .libs/libgdk-x11-2.0.so.0.2400.29 /usr/lib/crti.o = /usr/lib/crtbeginS.o -L/usr/local/lib -L/usr/lib .libs/gdk.o = .libs/gdkapplaunchcontext.o .libs/gdkcairo.o .libs/gdkcolor.o = .libs/gdkcursor.o .libs/gdkdisplay.o .libs/gdkdisplaymanager.o = .libs/gdkdnd.o .libs/gdkdraw.o .libs/gdkevents.o .libs/gdkfont.o = .libs/gdkgc.o .libs/gdkglobals.o .libs/gdkimage.o .libs/gdkkeys.o = .libs/gdkkeyuni.o .libs/gdkoffscreenwindow.o .libs/gdkpango.o = .libs/gdkpixbuf-drawable.o .libs/gdkpixbuf-render.o .libs/gdkpixmap.o = .libs/gdkpolyreg-generic.o .libs/gdkrectangle.o = .libs/gdkregion-generic.o .libs/gdkrgb.o .libs/gdkscreen.o = .libs/gdkselection.o .libs/gdkvisual.o .libs/gdkwindow.o = .libs/gdkwindowimpl.o .libs/gdkenumtypes.o .libs/gdkmarshalers.o = --whole-archive x11/.libs/libgdk-x11.a --no-whole-archive = -lpangocairo-1.0 -lpango-1.0 -lgio-2.0 -lfontconfig -lfreetype -lXrender = -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lXfixes = -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo -lpthread -lX11 = -lXext -lm -soname libgdk-x11-2.0.so.0 -version-script = .libs/libgdk-x11-2.0.so.0.2400.29-ver -lgcc --as-needed -lgcc_s = --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed = /usr/lib/crtendS.o /usr/lib/crtn.o >> /usr/bin/ld: .libs/gdkcairo.o(.text+0x61c): unresolvable = R_ARM_MOVW_ABS_NC relocation against symbol `g_free' >> /usr/bin/ld: final link failed: Nonrepresentable section on output >> clang: error: linker command failed with exit code 1 (use -v to see = invocation) >> Makefile:1098: recipe for target 'libgdk-x11-2.0.la' failed >> gmake[6]: *** [libgdk-x11-2.0.la] Error 1 >> gmake[6]: Leaving directory = '/usr/obj/portswork/usr/ports/x11-toolkits/gtk20/work/gtk+-2.24.29/gdk' >> Makefile:1238: recipe for target 'all-recursive' failed >> gmake[5]: *** [all-recursive] Error 1 >> gmake[5]: Leaving directory = '/usr/obj/portswork/usr/ports/x11-toolkits/gtk20/work/gtk+-2.24.29/gdk' >> Makefile:1018: recipe for target 'all' failed >> gmake[4]: *** [all] Error 2 >> gmake[4]: Leaving directory = '/usr/obj/portswork/usr/ports/x11-toolkits/gtk20/work/gtk+-2.24.29/gdk' >> Makefile:729: recipe for target 'all-recursive' failed >> gmake[3]: *** [all-recursive] Error 1 >> gmake[3]: Leaving directory = '/usr/obj/portswork/usr/ports/x11-toolkits/gtk20/work/gtk+-2.24.29' >> Makefile:621: recipe for target 'all' failed >> gmake[2]: *** [all] Error 2 >> gmake[2]: Leaving directory = '/usr/obj/portswork/usr/ports/x11-toolkits/gtk20/work/gtk+-2.24.29' >> =3D=3D=3D> Compilation failed unexpectedly. >> Try to set MAKE_JOBS_UNSAFE=3Dyes and rebuild before reporting the = failure to >> the maintainer. >> *** Error code 1 >=20 >=20 > Where the prior activity to produce .libs/gdkcairo.o was: >=20 >> /bin/sh ../libtool --tag=3DCC --mode=3Dcompile /usr/bin/clang -v = -target armv6--freebsd11.0-gnueabi -march=3Darmv7-a -mcpu=3Dcortex-a7 = -mfloat-abi=3Dsoftfp -mno-unaligned-access -DHAVE_CONFIG_H -I. -I.. = -DG_LOG_DOMAIN=3D\"Gdk\" -DGDK_COMPILATION -I.. -I.. -I../gdk = -DG_DISABLE_CAST_CHECKS -I/usr/local/include/glib-2.0 = -I/usr/local/lib/glib-2.0/include -I/usr/local/include = -I/usr/local/include/pango-1.0 -I/usr/local/include/cairo = -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 = -I/usr/local/include/libdrm -I/usr/local/include/libpng16 = -I/usr/local/include/gio-unix-2.0/ -I/usr/local/include/gdk-pixbuf-2.0 = -pthread -D_THREAD_SAFE -I/usr/local/include = -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES = -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES = -I/usr/local/include -D_THREAD_SAFE -pipe -mfloat-abi=3Dsoftfp -g = -fno-strict-aliasing -Wall -MT gdkcairo.lo -MD -MP -MF = .deps/gdkcairo.Tpo -c -o gdkcairo.lo gdkcairo.c >=20 > . . . >> "/usr/bin/clang" -cc1 -triple armv7--freebsd11.0-gnueabi -emit-obj = -mrelax-all -disable-free -main-file-name gdkcairo.c -mrelocation-model = static -mthread-model posix -mdisable-fp-elim -relaxed-alias >> ing -masm-verbose -mconstructor-aliases -target-cpu cortex-a7 = -target-feature +soft-float-abi -target-feature +strict-align = -target-abi aapcs-linux -mfloat-abi soft -v -dwarf-column-info = -debug-info-k >> ind=3Dstandalone -dwarf-version=3D2 -debugger-tuning=3Dgdb = -coverage-file = /usr/obj/portswork/usr/ports/x11-toolkits/gtk20/work/gtk+-2.24.29/gdk/gdkc= airo.c -resource-dir /usr/bin/../lib/clang/3.8.0 -dependen >> cy-file .deps/gdkcairo.Tpo -sys-header-deps -MP -MT gdkcairo.lo -D = HAVE_CONFIG_H -I . -I .. -D "G_LOG_DOMAIN=3D\"Gdk\"" -D GDK_COMPILATION = -I .. -I .. -I ../gdk -D G_DISABLE_CAST_CHECKS -I /usr/local/in >> clude/glib-2.0 -I /usr/local/lib/glib-2.0/include -I = /usr/local/include -I /usr/local/include/pango-1.0 -I = /usr/local/include/cairo -I /usr/local/include/pixman-1 -I = /usr/local/include/freetype2 -I /u >> sr/local/include/libdrm -I /usr/local/include/libpng16 -I = /usr/local/include/gio-unix-2.0/ -I /usr/local/include/gdk-pixbuf-2.0 -D = _THREAD_SAFE -I /usr/local/include -D G_DISABLE_SINGLE_INCLUDES -D AT >> K_DISABLE_SINGLE_INCLUDES -D GDK_PIXBUF_DISABLE_SINGLE_INCLUDES -D = GTK_DISABLE_SINGLE_INCLUDES -I /usr/local/include -D _THREAD_SAFE -Wall = -fdebug-compilation-dir /usr/obj/portswork/usr/ports/x11-tool >> kits/gtk20/work/gtk+-2.24.29/gdk -ferror-limit 19 -fmessage-length = 200 -pthread -fallow-half-arguments-and-returns -fno-signed-char = -fobjc-runtime=3Dgnustep -fdiagnostics-show-option -fcolor-diagnostics >> -o gdkcairo.o -x c gdkcairo.c > . . . >> libtool: compile: mv -f "gdkcairo.o" ".libs/gdkcairo.o" >=20 >=20 =3D=3D=3D Mark Millard markmi at dsl-only.net On 2016-Jan-10, at 3:55 AM, Mark Millard wrote: >=20 >=20 > On 2016-Jan-9, at 10:55 AM, Ian Lepore wrote: >>=20 >> On Sat, 2016-01-09 at 15:03 +0100, Dimitry Andric wrote: >>> On 09 Jan 2016, at 04:46, Mark Millard = wrote: >>>>=20 >>>> On 2016-Jan-7, at 2:57 PM, Dimitry Andric >>>> wrote: >>> ... >>>>> 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 >>>>=20 >>>> 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. >>>=20 >>> Yes, this is caused by too large call distances. In other words, = the >>> clang executable is getting to big to link. Apparently we need to = do >>> some tricks with -mlongcall to fix this. As I am no arm expert, I >>> welcome any patch submissions. :-) >>>=20 >>> -Dimitry >>>=20 >>=20 >> Here's the patch I got from Andy for the clang380 branch, modified = with >> Warner's suggestion to use MACHINE_CPUARCH instead of MACHINE. With >> this I can get a working arm world that will build a runnable >> helloworld.c (and .cc) on a dreamplug. (I.e., it appears clang 3.8.0 >> fixes the problem we had with clang 3.7.x where it wouldn't run at = all >> on armv4/5 systems). I have not tried compling anything complex yet. >>=20 >> -- Ian >=20 >=20 > Context: When I build I normally build lldb and the like as well, even = using WITH_CLANG_EXTRAS=3D . >=20 > In trying to get lldb to link I eventually get to the point that = libc++ is getting relocation truncations. Before getting to that I deal = with /usr/src/usr.bin/clang/lldb/Makefile to cover what is initially = reported during buildworld for lldb relocation truncations. Then with = that in place and retrying I get reports from libc++.a for a couple of = the contained .o files having relocations that are truncated (before it = reports "additional relocation overflows omitted from the output"): >=20 > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(thread.o) > /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o) >=20 > (Both have messages from multiple places in each .o file.) >=20 > As far as I can tell for general use -long-calls is going to be needed = for at least some system level .a library content if the .a's are to be = used. >=20 > Which leaves me wondering if STATIC_CXXFLAGS having -mlong-calls for = arm system libraries fairly generally is appropriate for those intending = on building the arm-native clang toolchain and related material in = buildworld. (STATIC_CFLAGS too?) A significant case analysis of what = happens to currently be too far apart would be fragile as things grow = even more later. >=20 > This sort of issue may well not be limited to TARGET=3Darm contexts. >=20 > The detailed libc++.a relocation truncation complaints that I got = were: >=20 >=20 >> --- all_subdir_lldb --- >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(thread.o): In = function = `_ZNSt3__16vectorINS_4pairIPNS_18condition_variableEPNS_5mutexEEENS_18__hi= dden_allocatorIS6_EEE21__push_back_slow_pathIS6_EEvOT_': >> = /usr/src/lib/libc++/../../contrib/libc++/src/thread.cpp:(.text._ZNSt3__16v= ectorINS_4pairIPNS_18condition_variableEPNS_5mutexEEENS_18__hidden_allocat= orIS6_EEE21__push_back_slow_pathIS6_EEvOT_[_ZNSt3__16vectorINS_4pairIPNS_1= 8condition_variableEPNS_5mutexEEENS_18__hidden_allocatorIS6_EEE21__push_ba= ck_slow_pathIS6_EEvOT_]+0x30): relocation truncated to fit: R_ARM_CALL = against symbol = `std::__1::__vector_base_common::__throw_length_error() const' = defined in = .text._ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv[_ZNKS= t3__120__vector_base_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(thread.o): In = function = `_ZNSt3__16vectorIPNS_17__assoc_sub_stateENS_18__hidden_allocatorIS2_EEE21= __push_back_slow_pathIRKS2_EEvOT_': >> = /usr/src/lib/libc++/../../contrib/libc++/src/thread.cpp:(.text._ZNSt3__16v= ectorIPNS_17__assoc_sub_stateENS_18__hidden_allocatorIS2_EEE21__push_back_= slow_pathIRKS2_EEvOT_[_ZNSt3__16vectorIPNS_17__assoc_sub_stateENS_18__hidd= en_allocatorIS2_EEE21__push_back_slow_pathIRKS2_EEvOT_]+0x30): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__vector_base_common::__throw_length_error() const' = defined in = .text._ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv[_ZNKS= t3__120__vector_base_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 > . . . >> --- all_subdir_clang --- >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_compare(char const*, char = const*, char const*, char const*) const': > . . . >> --- all_subdir_clang --- >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x81ec): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) > . . . >> --- all_subdir_clang --- >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x82c0): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_transform(char const*, char = const*) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x8430): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_compare(wchar_t const*, = wchar_t const*, wchar_t const*, wchar_t const*) const': >=20 >> --- all_subdir_clang --- >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x88a8): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x899c): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate_byname::do_transform(wchar_t = const*, wchar_t const*) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text+0x8b34): = relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate::do_transform(char const*, char = const*) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text._ZNKSt3__17= collateIcE12do_transformEPKcS3_[_ZNKSt3__17collateIcE12do_transformEPKcS3_= ]+0x34): relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::collate::do_transform(wchar_t const*, = wchar_t const*) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text._ZNKSt3__17= collateIwE12do_transformEPKwS3_[_ZNKSt3__17collateIwE12do_transformEPKwS3_= ]+0x38): relocation truncated to fit: R_ARM_CALL against symbol = `std::__1::__basic_string_common::__throw_length_error() const' = defined in = .text._ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv[_ZNK= St3__121__basic_string_commonILb1EE20__throw_length_errorEv] section in = /usr/obj/clang/arm.armv6/usr/src/usr.bin/clang/lldb/../../../lib/clang/lib= lldbCore/liblldbCore.a(CxaDemangle.o) >=20 >> /usr/obj/clang/arm.armv6/usr/src/tmp/usr/lib/libc++.a(locale.o): In = function `std::__1::num_put > = >::do_put(std::__1::ostreambuf_iterator >, std::__1::ios_base&, char, long) const': >> = /usr/src/lib/libc++/../../contrib/libc++/src/locale.cpp:(.text._ZNKSt3__17= num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8= ios_baseEcl[_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traits= IcEEEEE6do_putES4_RNS_8ios_baseEcl]+0x16c): additional relocation = overflows omitted from the output >=20 >=20 > Ian's/Andy's original patch is listed below for reference. >=20 >> Index: lib/clang/clang.lib.mk >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- lib/clang/clang.lib.mk (revision 293584) >> +++ lib/clang/clang.lib.mk (working copy) >> @@ -6,4 +6,8 @@ LLVM_SRCS=3D ${.CURDIR}/../../../contrib/llvm >>=20 >> INTERNALLIB=3D >>=20 >> +.if ${MACHINE_CPUARCH} =3D=3D "arm" >> +STATIC_CXXFLAGS+=3D-mlong-calls >> +.endif >> + >> .include >> Index: lib/csu/arm/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- lib/csu/arm/Makefile (revision 293584) >> +++ lib/csu/arm/Makefile (working copy) >> @@ -23,7 +23,7 @@ CLEANFILES+=3D crt1.s gcrt1.s Scrt1.s >> # directly compiled to .o files. >>=20 >> crt1.s: crt1.c >> - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c >> + ${CC} ${CFLAGS} -mlong-calls -S -o ${.TARGET} ${.CURDIR}/crt1.c >> sed ${SED_FIX_NOTE} ${.TARGET} >>=20 >> crt1.o: crt1.s >> @@ -30,7 +30,7 @@ crt1.o: crt1.s >> ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s >>=20 >> gcrt1.s: crt1.c >> - ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c >> + ${CC} ${CFLAGS} -mlong-calls -DGCRT -S -o ${.TARGET} = ${.CURDIR}/crt1.c >> sed ${SED_FIX_NOTE} ${.TARGET} >>=20 >> gcrt1.o: gcrt1.s >> Index: usr.bin/clang/clang/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- usr.bin/clang/clang/Makefile (revision 293584) >> +++ usr.bin/clang/clang/Makefile (working copy) >> @@ -11,7 +11,11 @@ SRCS=3D cc1_main.cpp \ >>=20 >> .if ${MK_SHARED_TOOLCHAIN} =3D=3D "no" >> NO_SHARED?=3D yes >> + >> +.if ${MACHINE_CPUARCH} =3D=3D "arm" >> +CFLAGS+=3D-mlong-calls >> .endif >> +.endif >>=20 >> LINKS=3D ${BINDIR}/clang ${BINDIR}/clang++ \ >> ${BINDIR}/clang ${BINDIR}/clang-cpp >>=20 >=20 From owner-freebsd-toolchain@freebsd.org Thu Jan 14 09:40:51 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 1A029A6DE6C for ; Thu, 14 Jan 2016 09:40:51 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-4.reflexion.net [208.70.210.4]) (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 B0B7A1F1D for ; Thu, 14 Jan 2016 09:40:50 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 7220 invoked from network); 14 Jan 2016 09:40:48 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 14 Jan 2016 09:40:48 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Thu, 14 Jan 2016 04:40:44 -0500 (EST) Received: (qmail 737 invoked from network); 14 Jan 2016 09:40:44 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 14 Jan 2016 09:40:44 -0000 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 9DAB91C43C1; Thu, 14 Jan 2016 01:40:46 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: libstand's -msoft-float use vs. clang 3.8.0 targeting powerpc64: 'not supported for ppc64' Message-Id: Date: Thu, 14 Jan 2016 01:40:46 -0800 To: FreeBSD PowerPC ML , FreeBSD Toolchain Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) 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: Thu, 14 Jan 2016 09:40:51 -0000 clang 3.8.0 on amd64 cross building for powerpc64 stopped in libstand's = build based on 'soft float is not supported for ppc64'. Apparently for = modern clang -msoft-float is a no-no. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Thu Jan 14 09:54:08 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 DC4D4A804C2 for ; Thu, 14 Jan 2016 09:54:08 +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 7924E1A38 for ; Thu, 14 Jan 2016 09:54:08 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 3433 invoked from network); 14 Jan 2016 09:54:16 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 14 Jan 2016 09:54:16 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Thu, 14 Jan 2016 04:54:09 -0500 (EST) Received: (qmail 24477 invoked from network); 14 Jan 2016 09:54:09 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 14 Jan 2016 09:54:09 -0000 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 22634B1E002; Thu, 14 Jan 2016 01:54:06 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: clang 3.8.0 amd64 targeting powerpc64 accepts -mlong-calls (instead of -mlongcall) Message-Id: Date: Thu, 14 Jan 2016 01:54:06 -0800 To: FreeBSD PowerPC ML , FreeBSD Toolchain Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) 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: Thu, 14 Jan 2016 09:54:09 -0000 Context: projects/clang380-import based amd64 FreeBSD used to try = building for powerpc64 In csu/powerpc64/Makefile I replaced: > CFLAGS+=3D -I${.CURDIR}/../common \ > -I${.CURDIR}/../../libc/include \ > -mlongcall . . . > CC:=3D gcc > COMPILER_TYPE:=3D gcc with > CFLAGS+=3D -I${.CURDIR}/../common \ > -I${.CURDIR}/../../libc/include \ > -mlong-calls . . . > #CC:=3D gcc > #COMPILER_TYPE:=3D gcc and clang 3.8.0 targeting powerpc64 sailed through and past it without = the slightest complaint about it. (It later reported that 'soft float is = not supported for ppc64' from the -msoft-float that is always used for = libstand.) =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Fri Jan 15 17:18:21 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 CE537A830CF; Fri, 15 Jan 2016 17:18:21 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (mail.vlakno.cz [91.217.96.224]) by mx1.freebsd.org (Postfix) with ESMTP id 9A24B1EF9; Fri, 15 Jan 2016 17:18:21 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: by vlakno.cz (Postfix, from userid 1002) id 781341E22541; Fri, 15 Jan 2016 18:08:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=vlakno.cz; s=mail; t=1452877711; bh=nqwnyqLBJovcQ1PWBhC5tefmC4wOf/nwZCDK1Uhkidw=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=D6ehqsqkmQkAGlYJaOob+17ELtV3bo+R0MW+VCXN77464/NrGyxC5AHu3XAYdxSrp M85QAQ4vYPBiQ9CmUWoXNBBGM2klee457Ggyb3C2530Tz0pJBpPcepeBaUotiL5tu7 tIhX2F0LM2VREQ1vxNwRwL04mjTTlsCqQxmfijqg= Date: Fri, 15 Jan 2016 18:08:31 +0100 From: Roman Divacky To: Mark Millard Cc: FreeBSD PowerPC ML , FreeBSD Toolchain Subject: Re: clang 3.8.0 amd64 targeting powerpc64 accepts -mlong-calls (instead of -mlongcall) Message-ID: <20160115170831.GA34394@vlakno.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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: Fri, 15 Jan 2016 17:18:21 -0000 On Thu, Jan 14, 2016 at 01:54:06AM -0800, Mark Millard wrote: > Context: projects/clang380-import based amd64 FreeBSD used to try building for powerpc64 > > In csu/powerpc64/Makefile I replaced: > > > CFLAGS+= -I${.CURDIR}/../common \ > > -I${.CURDIR}/../../libc/include \ > > -mlongcall > . . . > > CC:= gcc > > COMPILER_TYPE:= gcc > > with > > > CFLAGS+= -I${.CURDIR}/../common \ > > -I${.CURDIR}/../../libc/include \ > > -mlong-calls > . . . > > #CC:= gcc > > #COMPILER_TYPE:= gcc > > and clang 3.8.0 targeting powerpc64 sailed through and past it without the slightest complaint about it. (It later reported that 'soft float is not supported for ppc64' from the -msoft-float that is always used for libstand.) That option only affects ARM. It doesn't have any effect on PPC64. Roman From owner-freebsd-toolchain@freebsd.org Fri Jan 15 18:11:49 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 1B3CAA84B47 for ; Fri, 15 Jan 2016 18:11:49 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-4.reflexion.net [208.70.210.4]) (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 7F1531E14 for ; Fri, 15 Jan 2016 18:11:47 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 28552 invoked from network); 15 Jan 2016 18:11:50 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 15 Jan 2016 18:11:50 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Fri, 15 Jan 2016 13:11:41 -0500 (EST) Received: (qmail 11860 invoked from network); 15 Jan 2016 18:11:40 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 15 Jan 2016 18:11:40 -0000 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 A13A31C43C4; Fri, 15 Jan 2016 10:11:36 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: clang 3.8.0 amd64 targeting powerpc64 accepts -mlong-calls (instead of -mlongcall) From: Mark Millard In-Reply-To: <20160115170831.GA34394@vlakno.cz> Date: Fri, 15 Jan 2016 10:11:39 -0800 Cc: FreeBSD PowerPC ML , FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: <2B8C0A2B-5979-449A-A09A-A078FF466BE2@dsl-only.net> References: <20160115170831.GA34394@vlakno.cz> To: Roman Divacky 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: Fri, 15 Jan 2016 18:11:49 -0000 On 2016-Jan-15, at 9:08 AM, Roman Divacky wrote: >=20 > On Thu, Jan 14, 2016 at 01:54:06AM -0800, Mark Millard wrote: >> Context: projects/clang380-import based amd64 FreeBSD used to try = building for powerpc64 >>=20 >> In csu/powerpc64/Makefile I replaced: >>=20 >>> CFLAGS+=3D -I${.CURDIR}/../common \ >>> -I${.CURDIR}/../../libc/include \ >>> -mlongcall >> . . . >>> CC:=3D gcc >>> COMPILER_TYPE:=3D gcc >>=20 >> with >>=20 >>> CFLAGS+=3D -I${.CURDIR}/../common \ >>> -I${.CURDIR}/../../libc/include \ >>> -mlong-calls >> . . . >>> #CC:=3D gcc >>> #COMPILER_TYPE:=3D gcc >>=20 >> and clang 3.8.0 targeting powerpc64 sailed through and past it = without the slightest complaint about it. (It later reported that 'soft = float is not supported for ppc64' from the -msoft-float that is always = used for libstand.) >=20 > That option only affects ARM. It doesn't have any effect on PPC64. >=20 > Roman Are you sure? My preliminary evidence: Clang 3.8.0 (and 3.7.1) commonly reports on unused arguments: > # clang -mlong-calls main.c > clang: warning: argument unused during compilation: '-mlong-calls' but no such message mentioning long-calls is in the script file recorded = during the activity. The recorded command lines for the relevant crt* = files have the -mlong-calls in them. Other messages about unused -isystem and -L arguments were recorded in = the overall activity. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Fri Jan 15 22:15:33 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 19A6FA83EF7 for ; Fri, 15 Jan 2016 22:15:33 +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 A7D4D1A33 for ; Fri, 15 Jan 2016 22:15:32 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 13440 invoked from network); 15 Jan 2016 22:15:35 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 15 Jan 2016 22:15:35 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Fri, 15 Jan 2016 17:15:28 -0500 (EST) Received: (qmail 13704 invoked from network); 15 Jan 2016 22:15:27 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 15 Jan 2016 22:15:27 -0000 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.124] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 911E31C43CA; Fri, 15 Jan 2016 14:15:20 -0800 (PST) From: Mark Millard Date: Fri, 15 Jan 2016 14:15:24 -0800 Subject: base/projects/clang3.8.0-import -r294096 buildworld targeting arm (for rpi2): assertion failed To: freebsd-arm , FreeBSD Toolchain Message-Id: <47CFB052-427F-4456-8759-DBB71BA087F9@dsl-only.net> Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) X-Mailer: Apple Mail (2.3112) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Fri, 15 Jan 2016 22:15:33 -0000 My attempted buildworld of -r294096 from amd64 targeting arm for an rpi2 = stopped with: > --- all_subdir_usr.sbin --- > Assertion failed: (Offset <=3D PieceOffset && "overlapping or = duplicate pieces"), function finalize, file = /usr/src/lib/clang/libllvmasmprinter/../../../contrib/llvm/lib/CodeGen/Asm= Printer/DwarfDebug.cpp, line 1561. . . . > --- all_subdir_usr.sbin --- > clang: note: diagnostic msg:=20 > ******************** >=20 > PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: > Preprocessed source(s) and associated run script(s) are located at: > clang: note: diagnostic msg: /tmp/parser-392d84.c > clang: note: diagnostic msg: /tmp/parser-392d84.sh > clang: note: diagnostic msg:=20 >=20 > ******************** > *** [parser.o] Error code 254 >=20 > make[4]: stopped in /usr/src/usr.sbin/nscd > 1 error Detailed context: make.conf: empty. src.conf: > TO_TYPE=3Darmv6 > # > 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 RPI2-NODBG: ident RPI2-NODBG >=20 > include "RPI2" >=20 > makeoptions DEBUG=3D-g # Build kernel with gdb(1) = debug symbols > options ALT_BREAK_TO_DEBUGGER > #options VERBOSE_SYSINIT # Enable verbose sysinit = messages >=20 > options KDB # Enable kernel debugger = support >=20 > # For minimum debugger support (stable branch) use: > #options KDB_TRACE # Print a stack trace for a = panic > options DDB # Enable the kernel debugger >=20 > nooptions INVARIANTS # Enable calls of extra sanity = checking > nooptions INVARIANT_SUPPORT # Extra sanity checks of = internal structures, required by INVARIANTS > nooptions WITNESS # Enable checks to detect = deadlocks and cycles > nooptions WITNESS_SKIPSPIN # Don't run witness on = spinlocks for speed > nooptions DIAGNOSTIC =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Fri Jan 15 22:22:14 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 8E2E1A84145; Fri, 15 Jan 2016 22:22:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (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 552671EA9; Fri, 15 Jan 2016 22:22:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::4409:1b0:7257:9b68] (unknown [IPv6:2001:7b8:3a7:0:4409:1b0:7257:9b68]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id D94222D56E; Fri, 15 Jan 2016 23:22:10 +0100 (CET) Subject: Re: base/projects/clang3.8.0-import -r294096 buildworld targeting arm (for rpi2): assertion failed Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2DE0FE60-F473-4D20-A9A1-9059910F9506"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: <47CFB052-427F-4456-8759-DBB71BA087F9@dsl-only.net> Date: Fri, 15 Jan 2016 23:24:05 +0100 Cc: freebsd-arm , FreeBSD Toolchain Message-Id: <243ABE58-4FB6-4990-9582-20820F3F57A8@FreeBSD.org> References: <47CFB052-427F-4456-8759-DBB71BA087F9@dsl-only.net> To: Mark Millard X-Mailer: Apple Mail (2.3112) 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: Fri, 15 Jan 2016 22:22:14 -0000 --Apple-Mail=_2DE0FE60-F473-4D20-A9A1-9059910F9506 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 15 Jan 2016, at 23:15, Mark Millard wrote: >=20 > My attempted buildworld of -r294096 from amd64 targeting arm for an = rpi2 stopped with: >=20 >> --- all_subdir_usr.sbin --- >> Assertion failed: (Offset <=3D PieceOffset && "overlapping or = duplicate pieces"), function finalize, file = /usr/src/lib/clang/libllvmasmprinter/../../../contrib/llvm/lib/CodeGen/Asm= Printer/DwarfDebug.cpp, line 1561. Yes, this is a pretty new assertion. It's reported upstream by Andrew = here: https://llvm.org/bugs/show_bug.cgi?id=3D26163 I'm currently bisecting where this started appearing. I'll make sure to = inform the person who caused it. :) -Dimitry --Apple-Mail=_2DE0FE60-F473-4D20-A9A1-9059910F9506 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.29 iEYEARECAAYFAlaZcY4ACgkQsF6jCi4glqN90wCeKmf1VgO+TdRIh7h6sYOH8ELh fWIAoOY8tc0yz2eORRU6Eb+No9/d9Nmq =WZHi -----END PGP SIGNATURE----- --Apple-Mail=_2DE0FE60-F473-4D20-A9A1-9059910F9506-- From owner-freebsd-toolchain@freebsd.org Sat Jan 16 00:01: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 3251EA84084 for ; Sat, 16 Jan 2016 00:01:15 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-4.reflexion.net [208.70.210.4]) (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 E8E5912D8 for ; Sat, 16 Jan 2016 00:01:14 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 31993 invoked from network); 16 Jan 2016 00:01:13 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 16 Jan 2016 00:01:13 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Fri, 15 Jan 2016 19:01:13 -0500 (EST) Received: (qmail 19677 invoked from network); 16 Jan 2016 00:01:13 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 16 Jan 2016 00:01:13 -0000 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 8BEF61C43AE; Fri, 15 Jan 2016 16:01:07 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: clang 3.8.0 amd64 targeting powerpc64 accepts -mlong-calls (instead of -mlongcall) From: Mark Millard In-Reply-To: <2B8C0A2B-5979-449A-A09A-A078FF466BE2@dsl-only.net> Date: Fri, 15 Jan 2016 16:01:11 -0800 Cc: FreeBSD PowerPC ML , FreeBSD Toolchain Message-Id: References: <20160115170831.GA34394@vlakno.cz> <2B8C0A2B-5979-449A-A09A-A078FF466BE2@dsl-only.net> To: Roman Divacky X-Mailer: Apple Mail (2.2104) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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, 16 Jan 2016 00:01:15 -0000 On 2016-Jan-15, at 10:11 AM, Mark Millard = wrote: > On 2016-Jan-15, at 9:08 AM, Roman Divacky = wrote: >>=20 >> On Thu, Jan 14, 2016 at 01:54:06AM -0800, Mark Millard wrote: >>> Context: projects/clang380-import based amd64 FreeBSD used to try = building for powerpc64 >>>=20 >>> In csu/powerpc64/Makefile I replaced: >>>=20 >>>> CFLAGS+=3D -I${.CURDIR}/../common \ >>>> -I${.CURDIR}/../../libc/include \ >>>> -mlongcall >>> . . . >>>> CC:=3D gcc >>>> COMPILER_TYPE:=3D gcc >>>=20 >>> with >>>=20 >>>> CFLAGS+=3D -I${.CURDIR}/../common \ >>>> -I${.CURDIR}/../../libc/include \ >>>> -mlong-calls >>> . . . >>>> #CC:=3D gcc >>>> #COMPILER_TYPE:=3D gcc >>>=20 >>> and clang 3.8.0 targeting powerpc64 sailed through and past it = without the slightest complaint about it. (It later reported that 'soft = float is not supported for ppc64' from the -msoft-float that is always = used for libstand.) >>=20 >> That option only affects ARM. It doesn't have any effect on PPC64. >>=20 >> Roman >=20 > Are you sure? My preliminary evidence: >=20 > Clang 3.8.0 (and 3.7.1) commonly reports on unused arguments: >=20 >> # clang -mlong-calls main.c >> clang: warning: argument unused during compilation: '-mlong-calls' >=20 > but no such message mentioning long-calls is in the script file = recorded during the activity. The recorded command lines for the = relevant crt* files have the -mlong-calls in them. >=20 > Other messages about unused -isystem and -L arguments were recorded in = the overall activity. While taking a break I looked at the llvm/clang source some and what I = saw for as far as I got suggests that you are/were correct about those = *crt* file compiles: arm only for -mlong-calls --despite the lack of a = message about -mlong-calls being unused. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Sat Jan 16 07:08:03 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 04961A844BE for ; Sat, 16 Jan 2016 07:08:03 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-4.reflexion.net [208.70.210.4]) (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 AA3CF17F6 for ; Sat, 16 Jan 2016 07:08:01 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 20383 invoked from network); 16 Jan 2016 07:08:00 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 16 Jan 2016 07:08:00 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Sat, 16 Jan 2016 02:08:02 -0500 (EST) Received: (qmail 5987 invoked from network); 16 Jan 2016 07:08:02 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 16 Jan 2016 07:08:02 -0000 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 04E411C43C7; Fri, 15 Jan 2016 23:07:54 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: -mllvm -disable-ppc-float-in-variadic=true not recognized by clang 3.8.0; used in kern.mk for TARGET_ARCH=powerpc; more Message-Id: <8100D2B8-175D-4372-AEFB-6DF25889BD20@dsl-only.net> Date: Fri, 15 Jan 2016 23:07:59 -0800 To: FreeBSD PowerPC ML , FreeBSD Toolchain Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) 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, 16 Jan 2016 07:08:03 -0000 At least for amd64 clang 3.8.0 -> powerpc via TARGET_ARCH=3Dpowerpc = buildkernel I get the following clang command line options that stop the = build attempt. . . In sys/conf/kern.mk : The "CFLAGS.clang+=3D -mllvm -disable-ppc-float-in-variadic=3Dtrue" = line in > .if ${MACHINE_CPUARCH} =3D=3D "powerpc" > CFLAGS+=3D -mno-altivec > CFLAGS.clang+=3D -mllvm -disable-ppc-float-in-variadic=3Dtrue > CFLAGS.gcc+=3D -msoft-float > INLINE_LIMIT?=3D 15000 > .endif results in: > --- genassym.o --- > clang (LLVM option parsing): Unknown command line argument = '-disable-ppc-float-in-variadic=3Dtrue'. Try: 'clang (LLVM option = parsing) -help' > clang (LLVM option parsing): Did you mean = '-disable-ppc-ctrloop-analysis=3Dtrue'? (The above one is the main reason why I's also sending to toolchain: it = suggests some sort of change to earlier clang-specific command line = options.) In sys/conf/Makefile.powerpc : > CFLAGS+=3D -msoft-float -Wa,-many results in: > --- genassym.o --- > cc: error: unsupported argument '-many' to option 'Wa,' > *** [genassym.o] Error code 1 In sys/conf/kmod.mk : > .if ${MACHINE_CPUARCH} =3D=3D powerpc > CFLAGS+=3D -mlongcall -fno-omit-frame-pointer > .endif results in: > --- depend_subdir_dtrace --- > cc: error: unknown argument: '-mlongcall' . . . > --- depend_subdir_dtrace --- > *** [genassym.o] Error code 1 (no surprise). I stopped experimenting with this area after those 3. (They are not = listed in the order discovered.) =3D=3D=3D Mark Millard markmi at dsl-only.net