From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk0-x243.google.com (mail-vk0-x243.google.com [IPv6:2607:f8b0:400c:c05::243]) (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 5F6BC21DFA8F2 for ; Thu, 6 Apr 2017 12:42:17 -0700 (PDT) Received: by mail-vk0-x243.google.com with SMTP id y16so6722770vky.1 for ; Thu, 06 Apr 2017 12:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=20DNRMUoYiRe5EAJ3fpUXjU/Q9Ocx6d0ETj+IiYeusk=; b=q3CKaerusr04AyRGydjdkh6vM5BZq/+NfgkusJ70By7BPXvSJnz7PAGLdyTrdVgMwx fhvE/VkfJ7ipma2bjv1YeVLDZKzPdlvcZYtzeH3Q9bJAD2jkLk3FM+fIcHImYkqG4t4X H6TyD0q5OKZQwNUMGMAUmDv9Y/COsjR9D4fgAv3Bcnw93cmnTi3TE/i3nQUn8KaThjqF WnTr2Mor+KhfNYFTHZ6v6V1t9vcAXKrKDLetFllRfUSgeO+EaKo4ufJ+D2jZqMdB5wIc pSoAsK7kMpr1tPUzCvhQt47WaRJSYRYsHTp7caywWErSIVhVkGZLPU9S78l+TEzxsxM/ WeaQ== 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=20DNRMUoYiRe5EAJ3fpUXjU/Q9Ocx6d0ETj+IiYeusk=; b=qdZ0gGAfKVI42HOteFoXEzpp9l1Y8Ru7Hh4YnnzqAsWtvzLy0OGQM2igDNCJ6bXieH gclsYpJjtftOvgKvooCC9rKbnEuh7+0KXQKX/QZtpEdyTCPBUIYCqe+WqK3v0R3qERGw 3hRc9hPug5O5qlLTV/H/SaYJ+SoNceeaz8aBxDRzJ/hw4c+rXhHdfgEYjGuej53InDsV HdIXJNSE/pk38QvSsK29keQxV16KB0MFAtRpIw/Bhyi/CpHeiYRXJYADcvuRNoLgb8iu wWYpmgzwToiaVx5ngIW0l/tC7dRGXv6vxpF31ZThoskC/OTw1fyejmbaPD0sEI2jaVEE N80w== X-Gm-Message-State: AFeK/H0lNr4jDx6mvDjdZMvS3Oz5gorAJgfQHdebt0yEQiQMNFED0/ye6vYQWj5qsZTKOpFV3hrO76Cc+72Xwg== X-Received: by 10.176.80.82 with SMTP id z18mr3067240uaz.9.1491507736098; Thu, 06 Apr 2017 12:42:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.171.80 with HTTP; Thu, 6 Apr 2017 12:42:15 -0700 (PDT) In-Reply-To: References: From: Michael Zimmermann Date: Thu, 6 Apr 2017 21:42:15 +0200 Message-ID: To: Andrew Fish Cc: Peter Hornyack , "edk2-devel@lists.01.org" Subject: Re: Pull in pre-built library during edk2 build? 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: Thu, 06 Apr 2017 19:42:17 -0000 Content-Type: text/plain; charset=UTF-8 I'm doing the same in one of my projects where I link against a prebuilt gcc lib. Adding support for that is quite easy actually: https://github.com/efidroid/edk2/commit/841473c1c86823521dfad5eb3d74461557302e42 On Thu, Apr 6, 2017 at 8:57 PM, Andrew Fish wrote: > >> On Apr 6, 2017, at 11:07 AM, Peter Hornyack wrote: >> >> I'd like to make an adjustment to the edk2 build (locally, not for >> upstream) and I'm hoping someone can offer some guidance. >> >> My goal is to pre-build an edk2 library in a separate build process, >> then pull that library into the full build later on. Specifically I'm >> building my firmware image using OvmfPkgX64.dsc, but I want to build >> OpensslLib (CryptoPkg/Library/OpensslLib/OpensslLib.inf) in advance, >> then pull the resulting lib into the full build later. How can I >> achieve this? >> >> In my build output I can see that when OpensslLib.inf is built, all of >> the openssl .c files are compiled into .obj files, then an ar command >> wraps those up into OpensslLib.lib. I want to pull those steps out and >> pre-build OpensslLib.lib, but I've been unable to find where/how the >> edk2 build grabs that .lib file and turns it into the final firmware >> image. I've reviewed the edk2 build documentation but still can't >> figure this out. Can anyone point me to the right place in the edk2 >> build files where I can make this happen? Or perhaps is there an >> example of this already in the edk2 build that I can imitate? >> > > Peter, > > https://github.com/tianocore/edk2/blob/master/BaseTools/Conf/build_rule.template gets copied to Cont/build_rule.txt and these are the rules use to build the makefiles. > > In your INF file you can add a [BuildOptions] section and use that to modify the compiler, linker flags, etc for your module. > > This is the horrific example of what is possible: > https://github.com/tianocore/edk2/blob/master/EmulatorPkg/Unix/Host/Host.inf#L118 > > You can prune by compiler type, architecture, and which FLAG you want to use. I seem to remember = is append and == is replace. > > Thanks, > > Andrew Fish > >> Thanks, >> Peter >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel