From owner-freebsd-current@FreeBSD.ORG Fri Feb 22 14:21:52 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 16113AC6; Fri, 22 Feb 2013 14:21:52 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id D0BC229F; Fri, 22 Feb 2013 14:21:51 +0000 (UTC) Received: from [192.168.0.6] (spaceball.home.andric.com [192.168.0.6]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 871B15C43; Fri, 22 Feb 2013 15:21:47 +0100 (CET) Message-ID: <51277EFE.4000703@andric.com> Date: Fri, 22 Feb 2013 15:21:50 +0100 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20130117 Thunderbird/19.0 MIME-Version: 1.0 To: lev@FreeBSD.org, freebsd-current Subject: Re: r245741 (clang as cc) can not build binaries for GEODE processor References: <108875110.20130222104603@serebryakov.spb.ru> In-Reply-To: <108875110.20130222104603@serebryakov.spb.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2013 14:21:52 -0000 On 2013-02-22 07:46, Lev Serebryakov wrote: > I have -CURRENT i386 installation which runs r245741 now. > Default compiler is clang: > >> cc --version > FreeBSD clang version 3.2 (tags/RELEASE_32/final 170710) 20121221 > Target: i386-unknown-freebsd10.0 > Thread model: posix > > This system is used to build NanoBSD images (and ports for these > images) for my home router, which has AMD Geode CPU: > > Geode(TM) Integrated Processor by AMD PCS (499.91-MHz 586-class CPU) > > Build system has only one setting in /etc/src.conf and > /etc/make.conf: > > MALLOC_PRODUCTION=yes > > NanoBSD image build includes many options, and "CPUTYPE=geode" is > among them. > > Today I've rebuilt all ports (including samba36) and image (from > r247117). And new samba port (samba36-3.6.12) failed to start on > target system (with Geode CPU). It gets "SIGILL" (!!!). > > I was able to get core file by running "testparam" in NFS-mounted > R/W file system, but after that GDB (on build system, as NanoBSD > image doesn't contain one) says, that it could not access memory at > failure address to show disassembly: > >> gdb /usr/local/bin/testparm ~/testparm.core > GNU gdb 6.1.1 [FreeBSD] > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you are > welcome to change it and/or distribute copies of it under certain conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for details. > This GDB was configured as "i386-marcel-freebsd"...(no debugging symbols found)... > Core was generated by `testparm'. > Program terminated with signal 4, Illegal instruction. > #0 0x010351d6 in ?? () > (gdb) x/i $pc > 0x10351d6: Cannot access memory at address 0x10351d6 > (gdb) bt > #0 0x010351d6 in ?? () > #1 0x00000000 in ?? () > (gdb) As far as I know, Geodes should now work properly, after the long nops were disabled for it. But it could be that there are still some instructions generated that are not understood by the Geode. The default for FreeBSD on 32-bit x86 is i486, so maybe the problems are caused by the -march=geode setting. If you disable that, do the problems disappear? In any case, can you attempt to figure out which exact instructions it dies on? If gdb does not work, like you said above, maybe you can use objdump to disassemble the executable in question, and find the address of the failing instruction. -Dimitry