From owner-freebsd-mips@freebsd.org Thu Nov 24 17:41:05 2016 Return-Path: Delivered-To: freebsd-mips@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 954C2C533D9 for ; Thu, 24 Nov 2016 17:41:05 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 453FAEB for ; Thu, 24 Nov 2016 17:41:04 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id uAOHetDq002713 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Nov 2016 18:40:55 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: adrian.chadd@gmail.com Received: from eg.sd.rdtc.ru (eugen@localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTP id uAOHek7U094536; Fri, 25 Nov 2016 00:40:46 +0700 (KRAT) (envelope-from eugen@grosbein.net) Subject: Re: MIPS code size strangeness To: Adrian Chadd References: <5831E800.60003@grosbein.net> <5832FF33.9010307@grosbein.net> <58330AB6.60306@grosbein.net> <58332491.3000706@grosbein.net> <58332940.8030606@grosbein.net> <58346974.2020907@grosbein.net> <58371526.4050908@grosbein.net> Cc: "freebsd-mips@freebsd.org" From: Eugene Grosbein X-Enigmail-Draft-Status: N1110 Message-ID: <5837261E.9040700@grosbein.net> Date: Fri, 25 Nov 2016 00:40:46 +0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <58371526.4050908@grosbein.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, LOCAL_FROM autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * 1.9 DATE_IN_FUTURE_06_12 Date: is 6 to 12 hours after Received: date * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-Spam-Level: ** X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2016 17:41:05 -0000 On 24.11.2016 23:28, Eugene Grosbein wrote: > On 24.11.2016 05:11, Adrian Chadd wrote: >> It's the mips-xtoolchain or xtoolchain-mips-gcc or something > > Thanks! > > I've changed the port devel/powerpc64-gcc (master port for devel/mips-gcc) slightly > to build gcc-6.2.0 instead of gcc-5.3.0 and it builds and installs just fine > using command make FREEBSD_EXTENSION=yes install > > Then, I've installed devel/mips-xtoolchain-gcc and run buildworld using CROSS_TOOLCHAIN=mips-gcc. > It fails: > > --- cancelpoints_sem_new.o --- > {standard input}: Assembler messages: > {standard input}:1347: Error: opcode not supported on this processor: mips1 (mips1) `ll $5,4($4)' > {standard input}:1350: Error: opcode not supported on this processor: mips1 (mips1) `sc $5,4($4)' > {standard input}:1360: Error: opcode not supported on this processor: mips1 (mips1) `sync' > {standard input}:1456: Error: opcode not supported on this processor: mips1 (mips1) `ll $4,0($17)' > {standard input}:1459: Error: opcode not supported on this processor: mips1 (mips1) `sc $4,0($17)' > {standard input}:1469: Error: opcode not supported on this processor: mips1 (mips1) `sync' > {standard input}:1697: Error: opcode not supported on this processor: mips1 (mips1) `sync' > {standard input}:1702: Error: opcode not supported on this processor: mips1 (mips1) `ll $5,4($4)' > {standard input}:1705: Error: opcode not supported on this processor: mips1 (mips1) `sc $5,4($4)' > *** [cancelpoints_sem_new.o] Error code 1 > > I try to build code for TP-Link WDR3600. > I'm not familiar with MIPS assembler. Is there a way to alter gcc6 code generator to avoid this error? I've managed to build FreeBSD12/mips using gcc6 and additional src.conf knobs: CROSS_TOOLCHAIN=mips-gcc WITHOUT_CROSS_COMPILER=yes CROSSENV+=CFLAGS="-march=mips32" This time, ucl_hash_replace() function takes 628 bytes (0x274) instead of 25000: # nm -C -D --print-size --size-sort libprivateucl.so.1 | grep ucl_hash_replace 0003098c 00000274 T ucl_hash_replace However, libprivateucl.so.1 still takes 247224 bytes in case of FreeBSD12/mips comparing with 136064 bytes in case of FreeBSD11/amd64.