From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 785321A1E1E for ; Wed, 3 Aug 2016 01:22:36 -0700 (PDT) Received: by mail-it0-x22f.google.com with SMTP id f6so224660311ith.0 for ; Wed, 03 Aug 2016 01:22:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Cw5WKhvInyGFxEsbJy9IU4DSzIkJ5dh0sH6+PUSv9Hc=; b=Lqhu9yoQf6uPvfosh9BRA/rCsDSpWWSTtuXErm4XIXV/nGUuYz/K0EQ0ESjUuuerG0 feCwF1D0uOFdeHKDUC+lxH6MfdjUPR0zgN4zX89vmeVU3z54pp2rMh47yzX+OedzzxJ+ 6w/EjTMWA2mFkLKG8sal0zaEgNeixlqY/slOY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Cw5WKhvInyGFxEsbJy9IU4DSzIkJ5dh0sH6+PUSv9Hc=; b=ThSx5J4B9lvO6dcQWC3Cj2E1z665FQ5eKvUycAyxt2i5jjvVKCinJUQ8FWRmqfoK/n PAUtxxP0uBWHvRdgfQ45EBWpRuukgQ83OL2yTY4RIfKk1M2cQ38UY+ljNtpHmuDxKHDD SGQQCN7D7DOqJAPsYGdSqSWFx3O3vEZyWEdPGsyny7g1o+UvH7CXxrnY0WiX7WYZZQY/ a6Wc8pbFpIGGHlEb25d4TPZldkgi1HEyCb4vuZJoriXFR9wR6VWirvsc+JgCXpK/W6+M exNt3Qzl8uvdAJky1S821zLM9ajzpcZMnfWhDDMuc1EGoLiDi9eNumD9yK+buDCN3UYJ +Rhw== X-Gm-Message-State: AEkoouuS9G8rgJJw2Pdc/reIupJwvTCGRc1AW/KmqfrxWRUpsR7UmPimCLTeh42j6vesG4jpOdi2d/0jqcwIS/qK X-Received: by 10.36.57.215 with SMTP id l206mr25240894ita.5.1470212555823; Wed, 03 Aug 2016 01:22:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.204.195 with HTTP; Wed, 3 Aug 2016 01:22:35 -0700 (PDT) In-Reply-To: References: <1470148772-15712-1-git-send-email-ard.biesheuvel@linaro.org> <4A89E2EF3DFEDB4C8BFDE51014F606A1155E457A@shsmsx102.ccr.corp.intel.com> From: Ard Biesheuvel Date: Wed, 3 Aug 2016 10:22:35 +0200 Message-ID: To: "Gao, Liming" Cc: "Zhu, Yonghong" , "Justen, Jordan L" , "edk2-devel@lists.01.org" , "leif.lindholm@linaro.org" , "sigmaepsilon92@gmail.com" Subject: Re: [PATCH 0/3] BaseTools GCC: pass CC flags to linker X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2016 08:22:36 -0000 Content-Type: text/plain; charset=UTF-8 On 2 August 2016 at 16:51, Ard Biesheuvel wrote: > On 2 August 2016 at 16:50, Gao, Liming wrote: >> Ard: >> Without this change, GCC5 LTO can pass build. With it, what difference will be in the generated image? Original way may generate the wrong image, or new way will generate the smaller image? >> > > This is not about code size but about correctness. Compiler switches > for code model or alignment etc may affect the way code is generated > at link time by the LTO routines. Note that Steven mentions a similar problem in his CLANG38 series: he needs to pass -pie to the linker (or -fpie would be sufficient, I suspect) to prevent the linker from using the wrong code model when generating code from the LTO bytecode. Thanks, Ard.