From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (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 789B321A16ECB for ; Sat, 27 May 2017 05:26:51 -0700 (PDT) Received: by mail-io0-x235.google.com with SMTP id p24so22237070ioi.0 for ; Sat, 27 May 2017 05:27:47 -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=A0hpYlPwObuSclsX+GG9R9rbZTokNlDH5irvbsKdXDE=; b=g206kbyUcc4n1RuCf+DUh2/IgG7Pd3uEK+7mQwe9ry9AUBpuj0ZbTzAhTlK5Yp8xnV GMY8Qrx3AuPNJ+vmvi+iAOpO15dEM8rU7S7YhL9Qw4yFxNV2Rm3DO+QSsdi6+sYI/aPv hk82SKcI/+uOQKOaVbBTW6G6DagbVQtz7jU7Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=A0hpYlPwObuSclsX+GG9R9rbZTokNlDH5irvbsKdXDE=; b=oO7sgqb4qHd/BU0z6Scff2q0no9CKNP+e4olm1zfPQn8fpJEsQ9XWnpqE5gcUjUSd3 JNyqF3FXDcJUHByViWf4KzLccuUrCrHdYK692L800BlciN/6VrwI2jsoXPjL2X2szzh8 +YrZGdJvwxThdL7r9Lcc+RtER9TlyWeIRHe8tUFVnO2dVAV/oM94aZZh2oWB6gyEVBxm DZekpT82Q7s4fWSPfhRKHrRPuc/4Ke4FyvWKeTuhSAyJdIMeUT9/IQxgN1iDcs69qoEg k1B3di4GPE43jUJShbTC/YqowFL6N+H1rIA4IQb2ED9oIoOBUl71o2xsvcWPU495YHGj vJEg== X-Gm-Message-State: AODbwcDYuhEytTBWc1tmau3chwWY0mnU1gHLUMerI8tln2Yptf1l36ES NvReiz0E+PFOUL1n1VagF6gLlTxXhtOi X-Received: by 10.107.84.1 with SMTP id i1mr5611056iob.72.1495888066862; Sat, 27 May 2017 05:27:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.164.24 with HTTP; Sat, 27 May 2017 05:27:46 -0700 (PDT) In-Reply-To: References: <1495581673-10788-1-git-send-email-michael.d.kinney@intel.com> <542CF652F8836A4AB8DBFAAD40ED192A4C5E94B8@shsmsx102.ccr.corp.intel.com> <56801ADE-446F-43C2-9C99-5500E8EE5881@apple.com> <340C28EC-60CF-4390-A8AD-25F9DA22538F@apple.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14D734727@shsmsx102.ccr.corp.intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14D734868@shsmsx102.ccr.corp.intel.com> <9333E191E0D52B4999CE63A99BA663A00302B22075@atlms1.us.megatrends.com> From: Ard Biesheuvel Date: Sat, 27 May 2017 12:27:46 +0000 Message-ID: To: "Kinney, Michael D" Cc: Felix Poludov , "Gao, Liming" , "afish@apple.com" , Laszlo Ersek , "Wu, Hao A" , "edk2-devel@lists.01.org" , "Fan, Jeff" Subject: Re: [Patch] SourceLevelDebugPkg/SecPeiDebugAgentLib: Fix duplicate symbol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 May 2017 12:26:51 -0000 Content-Type: text/plain; charset="UTF-8" On 26 May 2017 at 23:06, Kinney, Michael D wrote: > Felix, > > Yes. I agree. I will work on a Bugzilla issue for this topic > and I prefer the idea of updating Base.h to check _MSC_VER value. > > The one challenge is that 'static' could be added in front of > GLOBAL_REMOVE_IF_UNREFERENCED, and it will build correctly with > VS2012 and newer, but would fail with older VS versions that > require __declspec(selectany) for size optimization. > As has been pointed out already in this thread (by Laszlo, I think), STATIC may trigger 'unused symbol' warnings that break the build under our warnings-as-errors policy, since the compiler can infer that no external references exist. So while STATIC is absolutely the way forward, #define'ing it in a way that affects existing code is likely to cause problems.