From patchwork Thu Oct 29 16:16:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1390240 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::33a; helo=mail-wm1-x33a.google.com; envelope-from=swupdate+bncbcxploxj6ikrbdow5p6akgqe66xwhgi@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=ZLv4dHN6; dkim-atps=neutral Received: from mail-wm1-x33a.google.com (mail-wm1-x33a.google.com [IPv6:2a00:1450:4864:20::33a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CMVvn0FC1z9sS8 for ; Fri, 30 Oct 2020 03:17:22 +1100 (AEDT) Received: by mail-wm1-x33a.google.com with SMTP id s25sf118737wmj.7 for ; Thu, 29 Oct 2020 09:17:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1603988237; cv=pass; d=google.com; s=arc-20160816; b=hkk/a7mBDlDvyWzPIwG7g5BdPt7azSs8E5zj+2AgpRg1dE9BqSGkkcf04nNbOle/l/ +Vfqi/wEHFRknTUrJ27CqwgpLZ7PYBVPoR5nt+/Biwk9qnaZAM9J5x/jPszM4TzEtt9B fv4D/9UBV3nKNr0PfwW+rL/5pzPQ+2j3h2wAaXRTAZ0PamP/9Xv4AI+lDtzH7iszyHnh pQExjtXrnBG4sFjDKrPAgK9lDm6OI7gMNnFz0RAEIx8AmL4RTboCggPAZgKGOfagOwtk GYEMvwQfQL3ShrhK/ivKX/vIswDwYGp8Ok0hJ+Dorpwv8OoXb8fxRcrK///dg6IwrRFX QljA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=y7bvezlnRWfR1jV2LOWnZZHuNDLfgHXu+4Mdn6XO2zI=; b=0NEKKHo2BrGGH5HLvUWJfAX1QLufqe+ibYR0FBZ6EeMcD3bYWUU9drjTbjBmptDu6B CRPLassq2WaA9ouFv91XkiPF2UlUSoufH5xvKNqUPBPjLxqMBNq4jZH2T+VawzpNDG6d QsfstJfe8uFeTQbG0Wy+IlaHrvBxWUUCfhwi7UiLSXEMGBoufNRiOwO336rei/21EgmF UoD9e/x8rl//iLX2eK/p+N6Ve7osrk1TQ/t/JXLC9P6BSofLqg2S+ejjhzySuPE9JNKX CdCMN8HegEdONJ3k8hNgLovxPxRgY5Ag1uhvgv42ULIQOci4VCvwh0xnNpSvhqausJD7 3c0A== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=y7bvezlnRWfR1jV2LOWnZZHuNDLfgHXu+4Mdn6XO2zI=; b=ZLv4dHN6FW1uQPaHKgdOFP5f4QWkbC/5Jq1RkLRB1oUWXFtfq3d6TyNrqEBAg/+v7C 6tz3uU5Lj1+/haEaVVQBd/+htS1IHFHTBzmo62nPiRiNKf/Ee0M5bMuCMrBEd46/BzMc NDCMGqeyxiJxrgM4gPJb3gIA0bluU8iWOJnw6JinkUQposHWkmfp9ttr0YxsWnk5akUE 306yRR4y1VIlFE9qOEEukk0uQ73e1063lAxiYcJjTtPB7l/k+IA/LHOJ8G3RyfCkDKak bgzhPWz1j/kRi2R89cLVdxOi6q4T6Jo5R1COG0rbQ8o6XFLkl9SfLq065+j3QN3sr8dk zHxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=y7bvezlnRWfR1jV2LOWnZZHuNDLfgHXu+4Mdn6XO2zI=; b=swNpTDOBrpHzzh52cpYZV8SOJJRmONGvSSrxb0uiPVREe0rRT4kn4bWsHWjtFqQmZD 8Y6ww6QKhIi0allBGAVUVQRv1MPQ75OWva+f0gwMn6QLiF4vbrsf0TDEjovRnNadxLoa H8mCz+ufVp3vZ6sHxKcnWMNp+8y+Eqj+d4ITtIvof4PBV4SOyWUiZD28S5uYiLH7GS7r FRojCbowlNOKLF7TfRFuCnn0c577PR3DOKkmYjZVcmuDJ+1xZIMskxSkR/9ogUEXOCbI TKahNN4VrbpyNyyQq7u5jqXQVIWh/2NcrrPjIlsYd+OMFwHNaXDtXJH7kdm/c1wOs0us 92Gg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM532uQAx1eIFMavGC/eXKdit7GEiBe59DaIbBm8amFGl2nQe2AnL7 jsrL8YNkJmmfY1b35X8VtnE= X-Google-Smtp-Source: ABdhPJyrc5z9+5B46SQD5JfhWIUXqb6igSTFMmdlYj9cKbXR1Oui+RpK9Cap41lnTgOZh+ZNWzIUiA== X-Received: by 2002:a5d:490c:: with SMTP id x12mr6455959wrq.193.1603988237547; Thu, 29 Oct 2020 09:17:17 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:adf:a544:: with SMTP id j4ls1958573wrb.3.gmail; Thu, 29 Oct 2020 09:17:16 -0700 (PDT) X-Received: by 2002:adf:eec2:: with SMTP id a2mr6984185wrp.128.1603988236379; Thu, 29 Oct 2020 09:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603988236; cv=none; d=google.com; s=arc-20160816; b=C8v7kWr6Tu/aJxj7O+NJDHA0nAYzSsFxZRELRl8mMWXh2yncG1zYX77fOlO+LIXmJe ZsT7PsUwKudvSg6kepHfCE8ZMRmyf0tludoc45dCX8du7xeLf1c8IyLChuesjXzvHtXX tCnrDKh7cNJMRGeJtdtkSVhfpTkD1h16KrXWbNyna8j9hEn2OWXETUSUJAj23fp1Sjpa te+mP1bFlSunWriXwGfbVn0+zg0piU8Vz91ALH587aidrXaaFE/QLPBQJYWY3M+vuPpS 1G+RI4oBQRvqq/3DAsrNhYKiVdiJlWGWnWV4870KrAPiyXNLbK3wOkFlzB1hrK9VybQ6 y99g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=eMVuFDI3oTVU6kggPQO7OgFH0ShcuzbyaOo00BBidgc=; b=q/RbxHbRdevJPDj0gHvb0MiS/PszPIiZqlTBoq++UzVNVB9lw72gRRXSJ0dQH1GH7D EZ0fgXB5FoYIcXlZgFLvLuNjMUY4G8urNlzkwZ1Ikaoqnwz7gYQaO5x9xJt014yz5aqx eEXew3OAR2bUwEboHBYDihJ1wTprLCjGVBxWSNp6Sb//jhJo8ojvH97itbADu2zuAuDp 7ADcsEgLEpANQqlfkBLyxz3o4JNj6Y1MZrN22zuUtdkmmSEjMR8kxcP65nTzxobEreIs hzt1zpQJ8v9snB9FU1m/OYflipAwCFAST3ogt8FvvzmmZE4ExCQldGNqREheVGA30naP JAAw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [2001:a60:0:28:0:1:25:1]) by gmr-mx.google.com with ESMTPS id w6si14546wmk.2.2020.10.29.09.17.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Oct 2020 09:17:16 -0700 (PDT) Received-SPF: neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=2001:a60:0:28:0:1:25:1; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4CMVvc1DB4z1rwDY; Thu, 29 Oct 2020 17:17:16 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CMVvc0sbpz1sM8c; Thu, 29 Oct 2020 17:17:16 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id MzUSrDzIYcYd; Thu, 29 Oct 2020 17:17:15 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Thu, 29 Oct 2020 17:17:15 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id EAD6D4540796; Thu, 29 Oct 2020 17:17:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VB-HoZaVxzTQ; Thu, 29 Oct 2020 17:17:12 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.64]) by babic.homelinux.org (Postfix) with ESMTP id 60E424540702; Thu, 29 Oct 2020 17:17:12 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: teufel.sava.jakovljev@gmail.com, Stefano Babic Subject: [swupdate] [PATCH] Create a shared library for IPC Date: Thu, 29 Oct 2020 17:16:57 +0100 Message-Id: <20201029161657.1153978-1-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Generate the IPC library asshared library, too, to be better used by multiple processes. Signed-off-by: Stefano Babic --- Makefile | 10 ++++++++-- lib/Makefile | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 lib/Makefile diff --git a/Makefile b/Makefile index a94c50d..3db7e25 100644 --- a/Makefile +++ b/Makefile @@ -358,7 +358,7 @@ include $(srctree)/Makefile.flags objs-y := core handlers libs-y := corelib ipc mongoose parser suricatta bootloader -shareds-y := bindings +shareds-y := bindings lib tools-y := tools swupdate-dirs := $(objs-y) $(libs-y) @@ -372,6 +372,8 @@ tools-bins := $(patsubst $(srctree)/$(tools-y)/%.c,$(tools-y)/%,$(wildcard $(src tools-bins-unstr:= $(patsubst %,%_unstripped,$(tools-bins)) tools-all := $(tools-objs) +libs := libswupdate.so.0.1 + ifeq ($(HAVE_LUA),y) lua_swupdate := lua_swupdate.so.0.1 endif @@ -391,7 +393,7 @@ cfg-sanity-check: exit 1; \ fi -all: swupdate ${tools-bins} ${lua_swupdate} +all: swupdate ${tools-bins} ${lua_swupdate} ${libs} # Do modpost on a prelinked vmlinux. The finally linked vmlinux has # relevant sections renamed as per the linker script. @@ -431,6 +433,9 @@ quiet_cmd_shared = LD $@ lua_swupdate.so.0.1: $(shared-libs) ${swupdate-libs} FORCE $(call if_changed,shared) +libswupdate.so.0.1: $(shared-libs) ${swupdate-libs} FORCE + $(call if_changed,shared) + ifeq ($(SKIP_STRIP),y) quiet_cmd_strip = echo $@ cmd_strip = cp $@_unstripped $@ @@ -460,6 +465,7 @@ install: all install -m 0644 $(srctree)/include/swupdate_status.h ${DESTDIR}/${INCLUDEDIR} install -m 0644 $(srctree)/include/progress_ipc.h ${DESTDIR}/${INCLUDEDIR} install -m 0755 ipc/lib.a ${DESTDIR}/${LIBDIR}/libswupdate.a + install -m 0755 ${libs} ${DESTDIR}/${LIBDIR} if [ $(HAVE_LUA) = y ]; then \ install -d ${DESTDIR}/${LIBDIR}/lua/$(LUAVER); \ install -m 0755 ${lua_swupdate} $(DESTDIR)/${LIBDIR}/lua/$(LUAVER); \ diff --git a/lib/Makefile b/lib/Makefile new file mode 100644 index 0000000..b6454ee --- /dev/null +++ b/lib/Makefile @@ -0,0 +1,7 @@ +# Copyright (C) 2020 Stefano Babic +# +# SPDX-License-Identifier: GPL-2.0-or-later + +obj-y += ../ipc/network_ipc.o ../ipc/network_ipc-if.o ../ipc/progress_ipc.o + +EXTRA_CFLAGS += -fPIC