From owner-freebsd-mips@freebsd.org Sun Nov 20 22:18:19 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 9DE2EC4C861 for ; Sun, 20 Nov 2016 22:18:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6899E13D0 for ; Sun, 20 Nov 2016 22:18:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id l8so75870006iti.1 for ; Sun, 20 Nov 2016 14:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=51/D4X8nU6/PbVk2741zDYgpuzYr+XTKwikSCmkz/5w=; b=0aMcR2Vter5yhE7y+KnphEsLcfjymco8HlH2j19L8NGQmTs4CbWb0SU1CuWTxEsdOc dLyi7bFwqMPAzxQW/LEsOXPXgUNZi6OyQBi3GkqMOnrsvbjX+NFZxXccLHwo20Go1X6R BSrKh/6grJ4gufdQvgpC427p2/DLYuqUm3POr9o2pE08aG8hLvENtnQvGq36rOBEUdvq NWO2hW6hjEPNVWAwBUwz/BwAxAMy1OKhSZypdLqCZXw1FAbfYWmuG+Q/X/HKCBVt5mJA Y8S9IIPMeOMql+24FK2vmMq/dySJK8jXr2fyCiRE/kfGGTCVIpViKqXQc+dHvfKaC4it RBrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=51/D4X8nU6/PbVk2741zDYgpuzYr+XTKwikSCmkz/5w=; b=jf6URZes3ug9tRv+/+GxA32zdCygLeNeQJ9bcVl/moPmmOEirgU9lDC7s0dHqjQmjC eG8FhiBGM03b4dafPmPGcRq69Ym0Qy5rX/US9vu23y0T10buNSifcWzozDklR36sipZ3 pCGH4n2tW3nhN/7rL16CgdlBtC2pyHJRHu1UKl6cNBSYZ5OAdD+CDC5gy4fdwMNhdc85 LoflRAjPXKpLxyS6sCWxAtTappnwsZKdAQp/FlMcECvMoPMUAZMUgoeelx48mXk6NWlE KUMs5nEd4m0KZrf09mdh7R3Vsuo6ACG8esWdosWQ4jaWWRY7BQV7FUr/JbK24KKZpC0E Acwg== X-Gm-Message-State: AKaTC017dfHlo+wLxUrgW+APj9I7o+uMLFEAn1QaB1OdKo+H0iwz2AslJQvhGoqJdtoGmG5L1W3wu3CZ7IYlOA== X-Received: by 10.36.200.68 with SMTP id w65mr6726358itf.85.1479680298798; Sun, 20 Nov 2016 14:18:18 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.134.66 with HTTP; Sun, 20 Nov 2016 14:18:18 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <5831E800.60003@grosbein.net> References: <5831E800.60003@grosbein.net> From: Warner Losh Date: Sun, 20 Nov 2016 15:18:18 -0700 X-Google-Sender-Auth: T_pRyl9oMKnX7MZ4rk5mZ8QZDMo Message-ID: Subject: Re: MIPS code size strangeness To: Eugene Grosbein Cc: "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 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: Sun, 20 Nov 2016 22:18:19 -0000 On Sun, Nov 20, 2016 at 11:14 AM, Eugene Grosbein wrote: > Hi! > > I'm currently struggle trying to fit my FreeBSD 12/mips build into 8M flash available. > It used to fit with early 11.0-CURRENT and it has over megabyte overhead with 12.0-CURRENT. > > Large parts are /usr/bin and /usr/lib and I've found something very strange. > For example: /usr/lib/libprivateucl.so.1 has 136064 bytes for amd64 > and it has 241560 bytes for mips. > > "nm -C -D --print-size --size-sort libprivateucl.so.1" shows the symbol "ucl_hash_replace" > has 330 bytes (0x14a) for amd64 and it has 25000 bytes (sic! 0x61a8) for mips. > > I understand that amd64 version is built with clang and MIPS code generated with gcc. > But why such large difference? In no way such small function ucl_hash_replace() > should expand to 25000 machine code bytes. > > I suspect other parts of code may have this problem too. Keep in mind that FreeBSD uses clang for amd64, which is quite good at code generation, while we still have to use an ancient version of gcc for mips, which is known to produce kinda crappy code for mips. To know for sure, you'll need to look at the code. But since early 11-current, we haven't changed compilers. We've added a lot to the base system, so we may need to prune more than you used to need to do. Warner