From owner-svn-src-head@freebsd.org Thu Dec 24 21:10:24 2015 Return-Path: Delivered-To: svn-src-head@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 F2C42A50115; Thu, 24 Dec 2015 21:10:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AB4B1D59; Thu, 24 Dec 2015 21:10:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tBOLAJ2D093343 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 24 Dec 2015 23:10:19 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tBOLAJ2D093343 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tBOLAJw7093342; Thu, 24 Dec 2015 23:10:19 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Dec 2015 23:10:19 +0200 From: Konstantin Belousov To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern Message-ID: <20151224211019.GD3625@kib.kiev.ua> References: <201512071220.tB7CKRw0027858@repo.freebsd.org> <1450971642.25138.247.camel@freebsd.org> <20151224180053.GY3625@kib.kiev.ua> <1450988333.25138.261.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450988333.25138.261.camel@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 21:10:25 -0000 On Thu, Dec 24, 2015 at 01:18:53PM -0700, Ian Lepore wrote: > Oh, I know what's likely at the heart of this... I'm using gcc 4.2.1 > for arm v4/v5, because clang 3.7 is broken (works to crossbuild, but > fails to run native). The mrrc instruction was introduced at arm arch > 5E, I'll bet clang is defaulting to 5E and gcc defaults to 4. > > This is what's in my make.conf for the build that failed: > > WITH_GCC=yes > WITH_GNUCXX=yes > WITH_GCC_BOOTSTRAP=yes > WITHOUT_CLANG=yes > WITHOUT_CLANG_IS_CC=yes > WITHOUT_CLANG_BOOTSTRAP=yes > > Yep, just confirmed it, switched back to clang 3.7 for crossbuild and > no errors. I think that the following is the least intrusive change. I built it with your make.conf successfully (and make.conf seems to take effect judging by the build time). If you are fine with the change, I will commit right after confirming that ARMv6 build still results in correct code (building right now). diff --git a/lib/libc/arm/sys/__vdso_gettc.c b/lib/libc/arm/sys/__vdso_gettc.c index d75d866..1f43e72 100644 --- a/lib/libc/arm/sys/__vdso_gettc.c +++ b/lib/libc/arm/sys/__vdso_gettc.c @@ -34,8 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" +#if __ARM_ARCH >= 6 static inline uint64_t cp15_cntvct_get(void) { @@ -53,6 +55,7 @@ cp15_cntpct_get(void) __asm __volatile("mrrc\tp15, 0, %Q0, %R0, c14" : "=r" (reg)); return (reg); } +#endif #pragma weak __vdso_gettc u_int @@ -60,6 +63,7 @@ __vdso_gettc(const struct vdso_timehands *th) { uint64_t val; +#if __ARM_ARCH >= 6 /* * Userspace gettimeofday() is only enabled on ARMv7 CPUs, but * libc is compiled for ARMv6. Due to clang issues, .arch @@ -67,6 +71,9 @@ __vdso_gettc(const struct vdso_timehands *th) */ __asm __volatile(".word\t0xf57ff06f" : : : "memory"); /* isb */ val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); +#else + val = 0; +#endif return (val); }