From owner-freebsd-hackers@freebsd.org Thu Aug 2 19:04:51 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A362C104ACA1 for ; Thu, 2 Aug 2018 19:04:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) 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)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3424276989 for ; Thu, 2 Aug 2018 19:04:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id p81-v6so5025102itp.1 for ; Thu, 02 Aug 2018 12:04:51 -0700 (PDT) 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=+qdLA376qDZW02032ZNxQmGVf19gEWbSILc4KXUhPR0=; b=2I07QybQkWI7QEFjNmgiuk3aiFH+qB/45d46zLXoY3ddBqg9wd3+CEs1mXdMfm2isI Eo4M5xJF2t9jmsimkdX9H2Tk0+zCYprvh5J/RuJmFtCZxunSj9l8qZ/2SLFsMyhd+RVX XZb8pW+XcfP8N7PbFDOuqGuysYrXKntTIkjL9QddWnhXmQoK2uQbc9DLcjsoDdeiwKJJ 7cbOgcEphMQbDslNSm1gxOUf8UlgltC6vzZ6csW5pwH5/wPdN+ndR1s/+hRjGUqo6SRi EmDu9HNJjEC3uM51OvklGwd4VMSwUcQGsTaIoRb9wXTHzlH+XoJsqWAz4s4TuW6y9mt5 V99g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=+qdLA376qDZW02032ZNxQmGVf19gEWbSILc4KXUhPR0=; b=iUwsbd0NMbXzuTGquWltjTY1EgnkP/X3PPOHkXPfsqwSouanCyCn7Q5ymmeskKquPK fjV69o9qk2lkTchW5NlkpudIxpmoZppY9Sp199tu5aNHFxDMEtAd+j33PQs+Z5B8TUkW FvSFPdV0p13DJyJDmEiiv9zVS/o8YUtmkpDC2/52Pq4whCTzQ/aPTKm/jGup/CZVuy5m CxuqaVviWLM2jK4jO8u4AfV4aiTaiGe1D9t7tWu41wYsehfTmvWuuUg2yUtUN/E95uxZ lUCvnSFbxLvWbB1Zf45NoQDYZOiNbqLv/7GiFajrMysDjPk4nADbtWtiqys7Z5aF9PUA ejQQ== X-Gm-Message-State: AOUpUlE9MurMUT72usa31CyLdFv1PsXL/WHbtUBC4aCFDhUxjnX9khVT 2kuIEOhAIUFBvenRLZLlpibiGCq2krVs1rS57bW1oA== X-Google-Smtp-Source: AAOMgpd/DbgjbFe+SsX+/hc641Zyd9OvI2zTs0/BjppXdPYGpK2fiLksfchHTLqGVaT8urf66MaSRxeNZXnit8+pFGo= X-Received: by 2002:a24:4f52:: with SMTP id c79-v6mr3831544itb.36.1533236690458; Thu, 02 Aug 2018 12:04:50 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:4485:0:0:0:0:0 with HTTP; Thu, 2 Aug 2018 12:04:49 -0700 (PDT) X-Originating-IP: [86.153.210.77] In-Reply-To: <7a14aee9-8205-4fc7-a7a0-a9ed2f33751d@metricspace.net> References: <20180802153357.GA25687@spindle.one-eyed-alien.net> <7f143985-2ebb-210a-e314-0deebd3d9f5b@metricspace.net> <7a14aee9-8205-4fc7-a7a0-a9ed2f33751d@metricspace.net> From: Warner Losh Date: Thu, 2 Aug 2018 13:04:49 -0600 X-Google-Sender-Auth: _jIFjBkqGjQYrbw8vjNX4wY6clY Message-ID: Subject: Re: A few build system questions To: Eric McCorkle Cc: Brooks Davis , FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Aug 2018 19:04:51 -0000 On Thu, Aug 2, 2018 at 11:45 AM, Eric McCorkle wrote: > On 08/02/2018 12:56, Warner Losh wrote: > > > > > > On Thu, Aug 2, 2018, 5:19 PM Eric McCorkle > > wrote: > > > > On 08/02/2018 11:33, Brooks Davis wrote: > > > On Thu, Aug 02, 2018 at 11:17:06AM -0400, Eric McCorkle wrote: > > >> Hi, > > >> > > >> I have a few questions about how to accomplish some things with > the > > >> build system. > > >> > > >> First, I want to create some libraries that exist only as static > > >> archives, meaning no shared object (ex. libsomething.a, but no > > >> libsomething.so) > > > > > > If it's something for use by only the base system PRIVATELIB= will > > > do it (and change the name to libprivatesomethi.a). If you want > to be > > > broadly available outside the base system, NO_SHARED= should do it > > IIRC. > > > > If loader and kernel are able to use private libraries, then that is > > probably better, actually. > > > > > > They aren't. Src/stand depends on no objects in the system other than > > what is built in src/stand. What you are proposing is a non-starter. The > > loader > > I think you hit "send" too soon... > > Basically what I'm trying to do at this point is two things. > > First, I want to convert some certs into C declarations and embed them > into a static library, which can in turn be used to embed them into > applications. This is essentially the same thing that some drivers do, > where they embed the firmware binaries directly into the driver. > This is easy. > Second, and a (somewhat) separate thing, I'm trying to see if I can get > a PoC of extracting the specific primitives out of OpenSSL and using > them in place of the current software crypto implementations in kernel > and loader. (objcopy ought to be able to do this to a static library in > theory) > Such a strategy won't fly for various reasons. Userland, the loader and the kernel are all compiled with different options. You'll need to recompile for each and not do objcopy tricks because the current build model doesn't allow for that. Warner