From patchwork Tue May 21 19:01:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10954403 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3070016C1 for ; Tue, 21 May 2019 19:01:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20FF528AB0 for ; Tue, 21 May 2019 19:01:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1521528ABC; Tue, 21 May 2019 19:01:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AED6628AB2 for ; Tue, 21 May 2019 19:01:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728318AbfEUTBa (ORCPT ); Tue, 21 May 2019 15:01:30 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:43890 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728283AbfEUTBa (ORCPT ); Tue, 21 May 2019 15:01:30 -0400 Received: by mail-qt1-f196.google.com with SMTP id i26so21758168qtr.10 for ; Tue, 21 May 2019 12:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LnEXBJn2HA2hl5jOoOjqQBgyQQh0DgVZU+/vhW2PzgE=; b=U3kCT/tWrgou2AeJHSb5e/mRMCzZve/y+O2TPSkou3PgN4WMX/lkxYgbh6NO4JukQY wJv8aWZo1g0fgp1XtNyWqpHFYEez28G+/+C22F6QL+P+PQIv5IxYJmBsUHbHvMB0bEcQ rVn0u4FiT+6Qr9l+yVDMuIs/fb9yLuG1KB9KL1xYXu2fQuPekPjpFKjB1qeZj6OerZwt yUl8Mzhecd6jm0YPI/xlaBZygV6aItXI+hNpHcSREvJ1XRwvf+UxGxPVDEVbYy/jFwfP MPUwE6NgjU1+tx/Pn5KKjRHcOrqrGXstsVdhCgDK5OlMEteEkON4azXzUzJgHuXowtty N5Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LnEXBJn2HA2hl5jOoOjqQBgyQQh0DgVZU+/vhW2PzgE=; b=f7W6yOmyJVsJiJmFPXnsCL7XF5hU48Rb9wlm7PSd8o9fp6/HtXJRPsOWVi9pmRKYsP FjqBxhJN0VefkFeLBXcZYxs8H36cnCLpy2G+78CPluhCrRCXyULQna9CnlwfyR3lGPWo YZfdOiSrR8hz2vSErxBUV9Bje0VB03FNBHwylX2QHDEM+o55pSsdg6RQ6RhS7/fCSLLK YdXLfYbOQUGp0xZwk0KjFN7j+gcZK2xXvQKu4Wav2qDE7bgtRP0F9P8lZ0Rd7mg3aA9X ycb0ejEIP1OBWv20Wt+/W86udxK3ZteLvNr3ndqxTYnNJwNRope/Ho+z9mdPey+FeMuT CgJg== X-Gm-Message-State: APjAAAVpekI7TSz58jWwaRAe3Qb3nxqtHQKzlVlqjatub1f63UsGucY4 w6moLHrYuj9K6EtR2GzAe/InaD1dmfA= X-Google-Smtp-Source: APXvYqyWs0kLIb0B4sVMmAHoDClg6Ag6Iq5a8uI7dYKGFBlDrA4uIzwONE+9PQJE9+oFSGOwIw5CgA== X-Received: by 2002:a0c:9b94:: with SMTP id o20mr22488023qve.56.1558465289472; Tue, 21 May 2019 12:01:29 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id x206sm10175047qkb.71.2019.05.21.12.01.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 12:01:28 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hTA0t-0007Cj-Ve; Tue, 21 May 2019 16:01:27 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 1/7] ibacm: Fix format string warning on 32 bit compile Date: Tue, 21 May 2019 16:01:18 -0300 Message-Id: <20190521190124.27486-2-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190521190124.27486-1-jgg@ziepe.ca> References: <20190521190124.27486-1-jgg@ziepe.ca> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jason Gunthorpe Need to use PRIx64 to print uint64_t's Signed-off-by: Jason Gunthorpe --- ibacm/src/acm_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ibacm/src/acm_util.c b/ibacm/src/acm_util.c index a1fe922b2fb7fd..1c6b9690430ce6 100644 --- a/ibacm/src/acm_util.c +++ b/ibacm/src/acm_util.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -207,7 +208,7 @@ static void acm_if_iter(struct nl_object *obj, void *_ctx_and_cb) if (acm_if_get_pkey(rtnl_link_get_name(link), &pkey)) return; - acm_log(2, "name: %5s label: %9s index: %2d flags: %s addr: %s pkey: 0x%04x guid: 0x%lx\n", + acm_log(2, "name: %5s label: %9s index: %2d flags: %s addr: %s pkey: 0x%04x guid: 0x%" PRIx64 "\n", rtnl_link_get_name(link), label, rtnl_addr_get_ifindex(addr), rtnl_link_flags2str(rtnl_link_get_flags(link), flags_str, sizeof(flags_str)), From patchwork Tue May 21 19:01:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10954405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 73E4514B6 for ; Tue, 21 May 2019 19:01:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 641A528AB0 for ; Tue, 21 May 2019 19:01:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5869528AB2; Tue, 21 May 2019 19:01:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 060FE28ABA for ; Tue, 21 May 2019 19:01:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729298AbfEUTBb (ORCPT ); Tue, 21 May 2019 15:01:31 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:34061 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729293AbfEUTBb (ORCPT ); Tue, 21 May 2019 15:01:31 -0400 Received: by mail-qt1-f196.google.com with SMTP id h1so21861263qtp.1 for ; Tue, 21 May 2019 12:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=prOjJHwQAyQ/kIh4tusP6zHDdeXu+xuIEomT8Y6gQ9A=; b=HR+cPrBATijPiBYXvwcDbQlSnzdAI42qKxk2M8H8mqcqR/z9zv7HNkz2Pp8qhlCwLd p1nZpDxjWDHiKJbS+/O5VtGtuIND5Nl4KVzsmXi3JVE0PT5lVmuLgFahNzRVLCp81fuD tLy2Ek0LBA/tk38igjihhJnaequCvKPSckZjW73OCqtU1SUzQ3QWyYg7xTyYDDImlfFZ YwOVQbbmMnsY0vAkzuf/0MqGw617qUl6Wy9L5BC1URBt6F3LpsUqN1M1BP4iMV5nOgtd 6+Mxuh5y3/HX6Vah0jAUBFEwfAgvpSDPLlPmZXvGm6bpMQ8M3kn+hgX1rA7wcpcUB100 aEOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=prOjJHwQAyQ/kIh4tusP6zHDdeXu+xuIEomT8Y6gQ9A=; b=NDLyfeX3KIfAU6ASRhAyRGOEOsBbk3jZs7MJP/2wrm882ocrM3EtO+TJJy4fprPx1Z xUVtYRtEoN3OkRQgKbifT8W0zd+q/izh0pzhOgllT4HQjoEcMWvw9PzY8O4uLDz8/Bf3 udrk9dYUCvj8iB+YZWPbw+/b4rb07ikZA8bhbmYaiVcY5T6DQPPkUBeyi7vYcQy7+YEb FhOf5QQLKVovPbzZ3/LNG8QvhXUL28KWgp6ap5kYCMN8OdudkDqAefRVOjbjLMVeQK+5 Xf1VPizBZ1ScMT1b0U1ziYHOJ1BChSah57pB8K9Abyej4S055VnLKXmfuw6rjhQ/3tFo oKbg== X-Gm-Message-State: APjAAAVXVcKjN6EVlqNObMv3CtMqH/EEWqiRC7WFOcx5gIwnZsDoFgPF xMLqDsdbWxqdCZJe/6h4gdMnz+I82gU= X-Google-Smtp-Source: APXvYqwywjDneJCgutFX++YX9SbG+VjSF+jbEmLEmoSBfv/ZigvytqcbAQQ2tp0D9j0gXOwh2w6Y0Q== X-Received: by 2002:a0c:d985:: with SMTP id y5mr50322136qvj.130.1558465290049; Tue, 21 May 2019 12:01:30 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id n36sm13597574qtk.9.2019.05.21.12.01.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 12:01:28 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hTA0u-0007Co-1Y; Tue, 21 May 2019 16:01:28 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 2/7] hns: Remove unneeded malloc.h Date: Tue, 21 May 2019 16:01:19 -0300 Message-Id: <20190521190124.27486-3-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190521190124.27486-1-jgg@ziepe.ca> References: <20190521190124.27486-1-jgg@ziepe.ca> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jason Gunthorpe This header is only needed to access internal glibc stuff. Otherwise it confuses sparse. Signed-off-by: Jason Gunthorpe --- providers/hns/hns_roce_u_hw_v1.c | 1 - providers/hns/hns_roce_u_hw_v2.c | 1 - 2 files changed, 2 deletions(-) diff --git a/providers/hns/hns_roce_u_hw_v1.c b/providers/hns/hns_roce_u_hw_v1.c index dbe0a185d154f0..fceb57a549cccd 100644 --- a/providers/hns/hns_roce_u_hw_v1.c +++ b/providers/hns/hns_roce_u_hw_v1.c @@ -32,7 +32,6 @@ #include #include -#include #include "hns_roce_u_db.h" #include "hns_roce_u_hw_v1.h" #include "hns_roce_u.h" diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c index df1d9659ecb5a2..a9616022f0e655 100644 --- a/providers/hns/hns_roce_u_hw_v2.c +++ b/providers/hns/hns_roce_u_hw_v2.c @@ -33,7 +33,6 @@ #define _GNU_SOURCE #include #include -#include #include "hns_roce_u.h" #include "hns_roce_u_db.h" #include "hns_roce_u_hw_v2.h" From patchwork Tue May 21 19:01:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10954409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C09C8924 for ; Tue, 21 May 2019 19:01:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF50028AB2 for ; Tue, 21 May 2019 19:01:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3E9128AB8; Tue, 21 May 2019 19:01:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A37028AB2 for ; Tue, 21 May 2019 19:01:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729312AbfEUTBc (ORCPT ); Tue, 21 May 2019 15:01:32 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:44088 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728283AbfEUTBc (ORCPT ); Tue, 21 May 2019 15:01:32 -0400 Received: by mail-qk1-f195.google.com with SMTP id w25so11715640qkj.11 for ; Tue, 21 May 2019 12:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5MpwQ6tQ0aEMdn0ZXcDRd5/w2QuFnL63MJdz7xrMAhY=; b=bXe1bg8Y+y6/PnxGaoMykMkqwJ6MsysPM5nfEntQV6mNOKgpANWUhO4QAMARc7T0OK 9ztXj9+xRsNinldIeA60nAdrgoIeEFxjT85VO+b/sK9nfWlNfBtOAaEyS/Wd0tDsBvoD dGIaYNGqCxV50ueLuISmSlV0YP0oBSPJwXe8ovFU8GZ6qgxAMt48DsRwrNkFQlGMTiNJ Aq1t20nNvIRx9zmzdDV6OHnvAviNrAa7RgBRA2NjEJyDUpp1cFZnln0JU+dXj3BXCtrX uyERKExcWE52bFO1fyXgaUcNZebidY+MlOJV7MEC1FeLKu8b4xzuRwkGBOl1cd21EmVE tW7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5MpwQ6tQ0aEMdn0ZXcDRd5/w2QuFnL63MJdz7xrMAhY=; b=UEPDVba1KTD61SSXZGhJcaMGg/cDuOvz7NUyIh9dsdkwIrrAyvNHIylFd+bYcK/p0Z OKlfVA9zeoko44PT+T2BzbU/Cwy9H9as5SF0DMaXLg5/v4F7vaObN4mxQjMBvxU4Lf+y P/BUbGHC3uo0/a14OV9mjGfaHftGLsThoJivH4IVFLPNwdOSngu99IGwaDBL9XzE9vBm QBsTRTOnNFrdSaRGLzZ5gFrGYhBua8xQjUT34s6elfyB+Tr5D5WjbTpjamftNUCfZT64 gyjlSDn89DtdI7cAvwNlXVrbmq/Gf6OUhPeyZVHPAQzFfItQPKtkSRyGdIffn29lqe/j i9JA== X-Gm-Message-State: APjAAAWWy9j1aX7fYUHDfz1dk9Yf6y8MFFNdScpfzkRPox9Z86fW4j0x RgPnDgpkUQ9zfLet5S1aSd41L/+l8x4= X-Google-Smtp-Source: APXvYqzDLzvxpQ2GturrissyGzs+0KSHJZtHRceZsE3LuYoFLmoveLSmJhJcxpG20J5vWqX8cVBpZA== X-Received: by 2002:a05:620a:16b4:: with SMTP id s20mr65588371qkj.34.1558465290581; Tue, 21 May 2019 12:01:30 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id p28sm8832284qkj.14.2019.05.21.12.01.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 12:01:28 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hTA0u-0007Cw-3g; Tue, 21 May 2019 16:01:28 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 3/7] build: Use the system PYTHON_EXECUTABLE for gen-sparse Date: Tue, 21 May 2019 16:01:20 -0300 Message-Id: <20190521190124.27486-4-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190521190124.27486-1-jgg@ziepe.ca> References: <20190521190124.27486-1-jgg@ziepe.ca> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jason Gunthorpe All python scripts run from cmake should use PYTHON_EXECUTABLE and must support python3. Update gen-sparse's call to this standard. Signed-off-by: Jason Gunthorpe --- CMakeLists.txt | 30 +++++++++++++++--------------- buildlib/RDMA_Sparse.cmake | 2 +- buildlib/gen-sparse.py | 11 ++++++----- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31100e267f2150..cfd4c3cbf9481e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,6 +170,21 @@ endif() RDMA_BuildType() include_directories(${BUILD_INCLUDE}) +# Look for Python. We prefer some variant of python 3 if the system has it. +FIND_PACKAGE(PythonInterp 3 QUIET) +if (PythonInterp_FOUND) + # pyverbs can only use python3: + if (NO_PYVERBS) + set(CYTHON_EXECUTABLE "") + else() + FIND_PACKAGE(cython) + endif() +else() + # But we still must have python (be it 2) for the build process: + FIND_PACKAGE(PythonInterp REQUIRED) + set(CYTHON_EXECUTABLE "") +endif() + RDMA_CheckSparse() # Require GNU99 mode @@ -364,21 +379,6 @@ else() set(HAVE_FULL_SYMBOL_VERSIONS 1) endif() -# Look for Python. We prefer some variant of python 3 if the system has it. -FIND_PACKAGE(PythonInterp 3 QUIET) -if (PythonInterp_FOUND) - # pyverbs can only use python3: - if (NO_PYVERBS) - set(CYTHON_EXECUTABLE "") - else() - FIND_PACKAGE(cython) - endif() -else() - # But we still must have python (be it 2) for the build process: - FIND_PACKAGE(PythonInterp REQUIRED) - set(CYTHON_EXECUTABLE "") -endif() - # A cython & python-devel installation that matches our selected interpreter. if (CYTHON_EXECUTABLE) diff --git a/buildlib/RDMA_Sparse.cmake b/buildlib/RDMA_Sparse.cmake index 8fcfb758d5284f..3d03ce6283eec4 100644 --- a/buildlib/RDMA_Sparse.cmake +++ b/buildlib/RDMA_Sparse.cmake @@ -19,7 +19,7 @@ int main(int argc,const char *argv[]) {return 0;} set(HAVE_SPARSE TRUE PARENT_SCOPE) # Replace various glibc headers with our own versions that have embedded sparse annotations. - execute_process(COMMAND "${BUILDLIB}/gen-sparse.py" + execute_process(COMMAND "${PYTHON_EXECUTABLE}" "${BUILDLIB}/gen-sparse.py" "--out" "${BUILD_INCLUDE}/" "--src" "${CMAKE_SOURCE_DIR}/" RESULT_VARIABLE retcode) diff --git a/buildlib/gen-sparse.py b/buildlib/gen-sparse.py index c289da31c19d75..84781f4528feef 100755 --- a/buildlib/gen-sparse.py +++ b/buildlib/gen-sparse.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2015-2017 Obsidian Research Corp. # Licensed under BSD (MIT variant) or GPLv2. See COPYING. import argparse @@ -66,10 +66,10 @@ def apply_patch(src,patch,dest): subprocess.check_output(["patch","-f","--follow-symlinks","-V","never","-i",patch,"-o",dest,src]); if os.path.exists(dest + ".rej"): - print "Patch from %r failed"%(patch); + print("Patch from %r failed"%(patch)); return False; except subprocess.CalledProcessError: - print "Patch from %r failed"%(patch); + print("Patch from %r failed"%(patch)); return False; return True; @@ -81,7 +81,7 @@ def replace_header(fn): return; tries = tries + 1; - print "Unable to apply any patch to %r, tries %u"%(fn,tries); + print("Unable to apply any patch to %r, tries %u"%(fn,tries)); global failed; failed = True; @@ -119,7 +119,8 @@ args = parser.parse_args(); if args.save: # Get the glibc version string - ver = subprocess.check_output(["ldd","--version"]).splitlines()[0].split(' ')[-1]; + ver = subprocess.check_output(["ldd","--version"]).decode() + ver = ver.splitlines()[0].split(' ')[-1]; ver = ver.partition(".")[-1]; outdir = os.path.join(args.SRC,"buildlib","sparse-include",ver); if not os.path.isdir(outdir): From patchwork Tue May 21 19:01:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10954415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A18FD924 for ; Tue, 21 May 2019 19:01:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91BCC28AB0 for ; Tue, 21 May 2019 19:01:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8659C28AB2; Tue, 21 May 2019 19:01:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF82228AB7 for ; Tue, 21 May 2019 19:01:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729293AbfEUTBe (ORCPT ); Tue, 21 May 2019 15:01:34 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:43894 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729300AbfEUTBd (ORCPT ); Tue, 21 May 2019 15:01:33 -0400 Received: by mail-qt1-f194.google.com with SMTP id i26so21758349qtr.10 for ; Tue, 21 May 2019 12:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yRrcFGEbyx+hPo0HsL1IPBzWkHMm2ChjPx2mXLFfbus=; b=Hq1qiXoyKJ+PSsiivsR41/h3O64FbvRv2aON2cvgSwvi5MZxtVGs5FtzZqRzaHJrhh KfIQUpBbBZgE5t9m1/kayAne6Nh8PQ36h4rsyDGy2LEGq9YsQ+P/h71FNq54P6k0UT/D DzVN+NQYXdT9ZpDPyefEnoTPAuDyIy8GJ39whPztPmNasi3/fxVCZqeN4jzv5zKuxOe5 sbPzHX3Kl2E0kfxuh0nkWhl3qDEMievBgrgR3b7rHFqFkS5NR5K3TKEdkEYyHe7ewOvx BRv/9OzKMRVbrE0Ds1GeKVVwi/ayhrFD18+/V6u1sc7yXCqQKgQq933F1F8Bpb49iXbT xXfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yRrcFGEbyx+hPo0HsL1IPBzWkHMm2ChjPx2mXLFfbus=; b=RMkot6a9qBBA7kOQ1f6zRhlgrviDREK1nQGOVXLFLxgNOnVkTaDOAqxgS65zrNtb+4 m24sBh28cQvFCxfS0HXzPgIV6s2P0VzV88ia9WcAVAfBSof4HBX5XGfcB4fi/V6Av6D/ 8gExgr5Yo7NV8n/mmv8s+WqiOSulekASYfILQQXbMaU01kIR2nmTkI/E7WxFxfZwy+Lw +6h89boJwrYJzViogKXGJrkbICeSP2is+yW88yNJLLi1siR6WmfQl81H4sbdigIVS0ib kfqCCM/aPdV5xQUBL1/nshS71xCzATkYjP9TVO3WJNqDros/9FAAPlkdLMKmuR3Kxwxh tYIg== X-Gm-Message-State: APjAAAX3LfipEgNv885G4vZHMNgHPryvTBp6GfmZF9uV56ajoigdiTNZ I8B0w/P6gNsl/Ey4I2d7z+0A3bfv200= X-Google-Smtp-Source: APXvYqyXNhi+cr/HacNOhdstAsKIOXLYWa4eRaT0/RrJT44QF3r7Earq7K9LIt0hbO+iHnsf4ImKQA== X-Received: by 2002:a0c:fccc:: with SMTP id i12mr65183454qvq.12.1558465292251; Tue, 21 May 2019 12:01:32 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id t2sm10524417qkd.57.2019.05.21.12.01.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 12:01:29 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hTA0u-0007D2-4o; Tue, 21 May 2019 16:01:28 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 4/7] build: Support glibc 2.27 with sparse Date: Tue, 21 May 2019 16:01:21 -0300 Message-Id: <20190521190124.27486-5-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190521190124.27486-1-jgg@ziepe.ca> References: <20190521190124.27486-1-jgg@ziepe.ca> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jason Gunthorpe A few more things need patching to make sparse be warning free in glibc headers. Signed-off-by: Jason Gunthorpe --- buildlib/gen-sparse.py | 4 +- .../sparse-include/27/bits-sysmacros.h.diff | 24 ++++ buildlib/sparse-include/27/netinet-in.h.diff | 121 ++++++++++++++++++ buildlib/sparse-include/27/stdlib.h.diff | 23 ++++ buildlib/sparse-include/27/sys-socket.h.diff | 11 ++ 5 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 buildlib/sparse-include/27/bits-sysmacros.h.diff create mode 100644 buildlib/sparse-include/27/netinet-in.h.diff create mode 100644 buildlib/sparse-include/27/stdlib.h.diff create mode 100644 buildlib/sparse-include/27/sys-socket.h.diff diff --git a/buildlib/gen-sparse.py b/buildlib/gen-sparse.py index 84781f4528feef..67e64de3202331 100755 --- a/buildlib/gen-sparse.py +++ b/buildlib/gen-sparse.py @@ -7,11 +7,13 @@ import os import collections headers = { + "bits/sysmacros.h", "endian.h", "netinet/in.h", "pthread.h", - "sys/socket.h", "stdatomic.h", + "stdlib.h", + "sys/socket.h", }; def norm_header(fn): diff --git a/buildlib/sparse-include/27/bits-sysmacros.h.diff b/buildlib/sparse-include/27/bits-sysmacros.h.diff new file mode 100644 index 00000000000000..4ec58646f621af --- /dev/null +++ b/buildlib/sparse-include/27/bits-sysmacros.h.diff @@ -0,0 +1,24 @@ +--- /usr/include/bits/sysmacros.h 2018-04-16 20:14:20.000000000 +0000 ++++ include/bits/sysmacros.h 2019-05-16 19:30:02.096174695 +0000 +@@ -40,8 +40,8 @@ + __SYSMACROS_DECLARE_MAJOR (DECL_TEMPL) \ + { \ + unsigned int __major; \ +- __major = ((__dev & (__dev_t) 0x00000000000fff00u) >> 8); \ +- __major |= ((__dev & (__dev_t) 0xfffff00000000000u) >> 32); \ ++ __major = ((__dev & (__dev_t) 0x00000000000fff00ul) >> 8); \ ++ __major |= ((__dev & (__dev_t) 0xfffff00000000000ul) >> 32); \ + return __major; \ + } + +@@ -52,8 +52,8 @@ + __SYSMACROS_DECLARE_MINOR (DECL_TEMPL) \ + { \ + unsigned int __minor; \ +- __minor = ((__dev & (__dev_t) 0x00000000000000ffu) >> 0); \ +- __minor |= ((__dev & (__dev_t) 0x00000ffffff00000u) >> 12); \ ++ __minor = ((__dev & (__dev_t) 0x00000000000000fful) >> 0); \ ++ __minor |= ((__dev & (__dev_t) 0x00000ffffff00000ul) >> 12); \ + return __minor; \ + } + diff --git a/buildlib/sparse-include/27/netinet-in.h.diff b/buildlib/sparse-include/27/netinet-in.h.diff new file mode 100644 index 00000000000000..685f23fea71aef --- /dev/null +++ b/buildlib/sparse-include/27/netinet-in.h.diff @@ -0,0 +1,121 @@ +--- /usr/include/netinet/in.h 2018-04-16 20:14:20.000000000 +0000 ++++ include/netinet/in.h 2019-05-16 19:22:42.725853784 +0000 +@@ -22,12 +22,12 @@ + #include + #include + #include +- ++#include + + __BEGIN_DECLS + + /* Internet address. */ +-typedef uint32_t in_addr_t; ++typedef __be32 in_addr_t; + struct in_addr + { + in_addr_t s_addr; +@@ -116,7 +116,7 @@ + #endif /* !__USE_KERNEL_IPV6_DEFS */ + + /* Type to represent a port. */ +-typedef uint16_t in_port_t; ++typedef __be16 in_port_t; + + /* Standard well-known ports. */ + enum +@@ -175,36 +175,36 @@ + #define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET) + #define IN_CLASSB_MAX 65536 + +-#define IN_CLASSC(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000) ++#define IN_CLASSC(a) ((((uint32_t)(a)) & 0xe0000000) == 0xc0000000) + #define IN_CLASSC_NET 0xffffff00 + #define IN_CLASSC_NSHIFT 8 + #define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET) + +-#define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000) ++#define IN_CLASSD(a) ((((uint32_t)(a)) & 0xf0000000) == 0xe0000000) + #define IN_MULTICAST(a) IN_CLASSD(a) + +-#define IN_EXPERIMENTAL(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000) +-#define IN_BADCLASS(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000) ++#define IN_EXPERIMENTAL(a) ((((uint32_t)(a)) & 0xe0000000) == 0xe0000000) ++#define IN_BADCLASS(a) ((((uint32_t)(a)) & 0xf0000000) == 0xf0000000) + + /* Address to accept any incoming messages. */ +-#define INADDR_ANY ((in_addr_t) 0x00000000) ++#define INADDR_ANY ((uint32_t) 0x00000000) + /* Address to send to all hosts. */ +-#define INADDR_BROADCAST ((in_addr_t) 0xffffffff) ++#define INADDR_BROADCAST ((uint32_t) 0xffffffff) + /* Address indicating an error return. */ +-#define INADDR_NONE ((in_addr_t) 0xffffffff) ++#define INADDR_NONE ((uint32_t) 0xffffffff) + + /* Network number for local host loopback. */ + #define IN_LOOPBACKNET 127 + /* Address to loopback in software to local host. */ + #ifndef INADDR_LOOPBACK +-# define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) /* Inet 127.0.0.1. */ ++# define INADDR_LOOPBACK ((uint32_t) 0x7f000001) /* Inet 127.0.0.1. */ + #endif + + /* Defines for Multicast INADDR. */ +-#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) /* 224.0.0.0 */ +-#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001) /* 224.0.0.1 */ +-#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002) /* 224.0.0.2 */ +-#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */ ++#define INADDR_UNSPEC_GROUP ((uint32_t) 0xe0000000) /* 224.0.0.0 */ ++#define INADDR_ALLHOSTS_GROUP ((uint32_t) 0xe0000001) /* 224.0.0.1 */ ++#define INADDR_ALLRTRS_GROUP ((uint32_t) 0xe0000002) /* 224.0.0.2 */ ++#define INADDR_MAX_LOCAL_GROUP ((uint32_t) 0xe00000ff) /* 224.0.0.255 */ + + #if !__USE_KERNEL_IPV6_DEFS + /* IPv6 address */ +@@ -213,8 +213,8 @@ + union + { + uint8_t __u6_addr8[16]; +- uint16_t __u6_addr16[8]; +- uint32_t __u6_addr32[4]; ++ __be16 __u6_addr16[8]; ++ __be32 __u6_addr32[4]; + } __in6_u; + #define s6_addr __in6_u.__u6_addr8 + #ifdef __USE_MISC +@@ -253,7 +253,7 @@ + { + __SOCKADDR_COMMON (sin6_); + in_port_t sin6_port; /* Transport layer port # */ +- uint32_t sin6_flowinfo; /* IPv6 flow information */ ++ __be32 sin6_flowinfo; /* IPv6 flow information */ + struct in6_addr sin6_addr; /* IPv6 address */ + uint32_t sin6_scope_id; /* IPv6 scope-id */ + }; +@@ -371,12 +371,12 @@ + this was a short-sighted decision since on different systems the types + may have different representations but the values are always the same. */ + +-extern uint32_t ntohl (uint32_t __netlong) __THROW __attribute__ ((__const__)); +-extern uint16_t ntohs (uint16_t __netshort) ++extern uint32_t ntohl (__be32 __netlong) __THROW __attribute__ ((__const__)); ++extern uint16_t ntohs (__be16 __netshort) + __THROW __attribute__ ((__const__)); +-extern uint32_t htonl (uint32_t __hostlong) ++extern __be32 htonl (uint32_t __hostlong) + __THROW __attribute__ ((__const__)); +-extern uint16_t htons (uint16_t __hostshort) ++extern __be16 htons (uint16_t __hostshort) + __THROW __attribute__ ((__const__)); + + #include +@@ -385,7 +385,7 @@ + #include + #include + +-#ifdef __OPTIMIZE__ ++#ifdef __disabled_OPTIMIZE__ + /* We can optimize calls to the conversion functions. Either nothing has + to be done or we are using directly the byte-swapping functions which + often can be inlined. */ diff --git a/buildlib/sparse-include/27/stdlib.h.diff b/buildlib/sparse-include/27/stdlib.h.diff new file mode 100644 index 00000000000000..5ddced15cf71db --- /dev/null +++ b/buildlib/sparse-include/27/stdlib.h.diff @@ -0,0 +1,23 @@ +--- /usr/include/stdlib.h 2018-04-16 20:14:20.000000000 +0000 ++++ include/stdlib.h 2019-05-16 19:38:38.071615242 +0000 +@@ -130,6 +130,20 @@ + + /* Likewise for '_FloatN' and '_FloatNx'. */ + ++/* For whatever reason our sparse does not understand these new compiler types */ ++#undef __GLIBC_USE_IEC_60559_TYPES_EXT ++#define __GLIBC_USE_IEC_60559_TYPES_EXT 0 ++#undef __HAVE_FLOAT32 ++#define __HAVE_FLOAT32 0 ++#undef __HAVE_FLOAT32X ++#define __HAVE_FLOAT32X 0 ++#undef __HAVE_FLOAT64 ++#define __HAVE_FLOAT64 0 ++#undef __HAVE_FLOAT64X ++#define __HAVE_FLOAT64X 0 ++#undef __HAVE_FLOAT128 ++#define __HAVE_FLOAT128 0 ++ + #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT) + extern _Float16 strtof16 (const char *__restrict __nptr, + char **__restrict __endptr) diff --git a/buildlib/sparse-include/27/sys-socket.h.diff b/buildlib/sparse-include/27/sys-socket.h.diff new file mode 100644 index 00000000000000..92ee3bfa1e1b64 --- /dev/null +++ b/buildlib/sparse-include/27/sys-socket.h.diff @@ -0,0 +1,11 @@ +--- /usr/include/sys/socket.h 2018-04-16 20:14:20.000000000 +0000 ++++ include/sys/socket.h 2019-05-16 19:22:42.721853727 +0000 +@@ -54,7 +54,7 @@ + uses with any of the listed types to be allowed without complaint. + G++ 2.7 does not support transparent unions so there we want the + old-style declaration, too. */ +-#if defined __cplusplus || !__GNUC_PREREQ (2, 7) || !defined __USE_GNU ++#if 1 + # define __SOCKADDR_ARG struct sockaddr *__restrict + # define __CONST_SOCKADDR_ARG const struct sockaddr * + #else From patchwork Tue May 21 19:01:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10954407 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7FA9914B6 for ; Tue, 21 May 2019 19:01:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6ED1B28AB7 for ; Tue, 21 May 2019 19:01:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 636B028AB8; Tue, 21 May 2019 19:01:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E23B928AB0 for ; Tue, 21 May 2019 19:01:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729302AbfEUTBc (ORCPT ); Tue, 21 May 2019 15:01:32 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:46167 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729293AbfEUTBc (ORCPT ); Tue, 21 May 2019 15:01:32 -0400 Received: by mail-qk1-f195.google.com with SMTP id a132so11696711qkb.13 for ; Tue, 21 May 2019 12:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P2t3+c9ysN1rC5QhyAqJD0PA6V0JpRZ6T2st9xocQGk=; b=Te0MvSKYtVEhDN30fuRbCMzMeTnPtWXuO+EAQX5to0cf9Ewpn4i7xADYPUknqLBchv YO8owuWWK1P+UP/EfraODOwSuoLNBajLpzD76uGpG1G82q/4m9nOmQR/dYTZYImV0ML7 Pue7SDUOHASqh7NzRNhHGex0kTCs32/C6iyd6ZO3QIc8OyQEOeWQspOJjBOYRLyvnXLq N83x1fXCqOxKEkyhyyn83b7P69c/bohCj7pRfpJCSMvS3pRr5vDnFzo7vmWjgHxbHlDJ 5ETeINp68vx4JccPrLFMu+0FefJeeEVP32LIG35mvZ1refepflqHmTwZD9e5rZdgaEMp onJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P2t3+c9ysN1rC5QhyAqJD0PA6V0JpRZ6T2st9xocQGk=; b=QXxrEfb1UjiKEiHxiinbF53RFNXMYeKiYITQcUWQs4IEG0SZMkn7vI4unj2yg7tem0 GnEt5pRxL2aeye4JQHHQwNqlVvQLSHYQ08kSXrWnMmO9PjTCfXeKkwv8kvSI2VGoOZg9 ZEKvOL4e5HALEnJCZKPo04cZJO8LQ9Fazu2Fe+/Rat+5jYpzYfM+q1KFhaQMSvwuxvXd oUHmeDTtUPWE6jl/M+lKyOnVEGae7YgHSBoijnZlQ36mZa47KO4b0c9rDarkl2hZrZ+m SjBRZa7yA4D/Ov6N/ub0MJTLpwODLAkUDt6znjWOZY1zaijP42DJK1xsZA1igIYMB4QT hjbg== X-Gm-Message-State: APjAAAVahe0HT/EGx3JV8Z6C++kVELi+ISkYqZgqlnI+rKZUiNEl8STd eWwDz8p2F/00eV3tQsSmHW8pjrbxUe4= X-Google-Smtp-Source: APXvYqz2pPBnUqPI6+tkYzqzOYJad9TD9FJ5zd+7MeERtM1hzqUSM6xkM1WWt36fcEC2d0n7umbvcA== X-Received: by 2002:a05:620a:1278:: with SMTP id b24mr63929018qkl.265.1558465291080; Tue, 21 May 2019 12:01:31 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id o37sm13734319qta.86.2019.05.21.12.01.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 12:01:29 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hTA0u-0007D8-70; Tue, 21 May 2019 16:01:28 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 5/7] build: Revise how gen-sparse finds the system headers Date: Tue, 21 May 2019 16:01:22 -0300 Message-Id: <20190521190124.27486-6-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190521190124.27486-1-jgg@ziepe.ca> References: <20190521190124.27486-1-jgg@ziepe.ca> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jason Gunthorpe When the compiler is configured for true multi-arch the system headers are not in /usr/include anymore, but in one of the arch specific directories. Get gcc to give the include search path and look along that path for the system header location for patching. Signed-off-by: Jason Gunthorpe --- buildlib/RDMA_Sparse.cmake | 1 + buildlib/gen-sparse.py | 30 ++++++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/buildlib/RDMA_Sparse.cmake b/buildlib/RDMA_Sparse.cmake index 3d03ce6283eec4..72581fe5ceb9cf 100644 --- a/buildlib/RDMA_Sparse.cmake +++ b/buildlib/RDMA_Sparse.cmake @@ -22,6 +22,7 @@ int main(int argc,const char *argv[]) {return 0;} execute_process(COMMAND "${PYTHON_EXECUTABLE}" "${BUILDLIB}/gen-sparse.py" "--out" "${BUILD_INCLUDE}/" "--src" "${CMAKE_SOURCE_DIR}/" + "--cc" "${CMAKE_C_COMPILER}" RESULT_VARIABLE retcode) if(NOT "${retcode}" STREQUAL "0") message(FATAL_ERROR "glibc header file patching for sparse failed. Review include/*.rej and fix the rejects, then do " diff --git a/buildlib/gen-sparse.py b/buildlib/gen-sparse.py index 67e64de3202331..fe428b42a97462 100755 --- a/buildlib/gen-sparse.py +++ b/buildlib/gen-sparse.py @@ -5,6 +5,7 @@ import argparse import subprocess import os import collections +import re headers = { "bits/sysmacros.h", @@ -25,6 +26,27 @@ def norm_header(fn): return I; return None; +def find_system_header(args,hdr): + """/usr/include is not always where the include files are, particularly if we + are running full multi-arch as the azure_pipeline container does. Get gcc + to tell us where /usr/include is""" + if "incpath" not in args: + cpp = subprocess.check_output([args.cc, "-print-prog-name=cpp"],universal_newlines=True).strip() + data = subprocess.check_output([cpp, "-v"],universal_newlines=True,stdin=subprocess.DEVNULL, + stderr=subprocess.STDOUT) + args.incpath = []; + for incdir in re.finditer(r"^ (/\S+)$", data, re.MULTILINE): + incdir = incdir.group(1) + if "fixed" in incdir: + continue; + args.incpath.append(incdir) + + for incdir in args.incpath: + fn = os.path.join(incdir,hdr) + if os.path.exists(fn): + return fn + raise ValueError("Could not find system include directory."); + def get_buildlib_patches(dfn): """Within the buildlib directory we store patches for the glibc headers. Each patch is in a numbered sub directory that indicates the order to try, the @@ -78,7 +100,7 @@ def apply_patch(src,patch,dest): def replace_header(fn): tries = 0; for pfn in patches[fn]: - if apply_patch(os.path.join(args.REF,fn), + if apply_patch(find_system_header(args,fn), pfn,os.path.join(args.INCLUDE,fn)): return; tries = tries + 1; @@ -100,7 +122,7 @@ def save(fn,outdir): with open(flatfn,"wt") as F: try: subprocess.check_call(["diff","-u", - os.path.join(args.REF,fn), + find_system_header(args,fn), os.path.join(args.INCLUDE,fn)], stdout=F); except subprocess.CalledProcessError as ex: @@ -113,8 +135,8 @@ parser.add_argument("--out",dest="INCLUDE",required=True, help="Directory to write header files to"); parser.add_argument("--src",dest="SRC",required=True, help="Top of the source tree"); -parser.add_argument("--ref",dest="REF",default="/usr/include/", - help="System headers to manipulate"); +parser.add_argument("--cc",default="gcc", + help="System compiler to use to locate the default system headers"); parser.add_argument("--save",action="store_true",default=False, help="Save mode will write the current content of the headers to buildlib as a diff."); args = parser.parse_args(); From patchwork Tue May 21 19:01:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10954411 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E11BB17E0 for ; Tue, 21 May 2019 19:01:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D040428AB0 for ; Tue, 21 May 2019 19:01:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4ED528AB2; Tue, 21 May 2019 19:01:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6811028AB0 for ; Tue, 21 May 2019 19:01:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728283AbfEUTBc (ORCPT ); Tue, 21 May 2019 15:01:32 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:37475 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729300AbfEUTBc (ORCPT ); Tue, 21 May 2019 15:01:32 -0400 Received: by mail-qt1-f196.google.com with SMTP id o7so21836527qtp.4 for ; Tue, 21 May 2019 12:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=shrd5wbEj8w59PT3J7ifykJp8tIdzkzFFSvkWfrrl58=; b=NoYwB3uTq7UkkZ7bTo3cGxUxmwlnUD7Jw50tzbhKaDPWUo5LrVL8NdewAPVAC5m9HR H8yxgyWq1t5arEd5uBjqN8UZIpbGJKwFg8ua8YDHrux8TWZS9RmSbzb+AywdsmmzPhJQ uzedysmXRVVn0eQasjkQyJUwYvkoxk/2vQKIPtKnvQ6U/gG27tvVaRJmUJhk9AQe0Gr1 GxPVfZlmTJNY6IhQpdmh0vUPniVDDkZqz3T6peadPntO/DAaG0OASGHER+6TkjtWX4q6 U0xmmmZmLxky7R3ZyqbtKG1Wt4tf+ZEaiMIjrRhBkeuCqfPWMIRQ3gKf6/KnjwdP0dKy mDxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=shrd5wbEj8w59PT3J7ifykJp8tIdzkzFFSvkWfrrl58=; b=R4eXeBlOFfLE+i0bA5IhhPvQAXjWeEIOzVDaswqsu1oMgSlB770nIGnMSe8X4qTh5d p26B6mm/m7onNDW45kQH92l3O7Ryrm2/m1rV9NG/8umD1SDDzd9KAFKUazt1OSd20aoc hg6HikScwLvIxEy4OsbRI8rZ45c9Wj2yeSyVvcJYSXpRYc7sKzMqlBX/Mcxngs3Yaqs0 +OwW+gfviyBC53u72wg0t8oXiFSirNiUkIjbAncIUjKNCtqXPsUzbT84fbaePslR2SDN k7KGwkWrhqUxsVvcDDBCtTHVcwNt+8mTI7wbRO3tyIkB55BJ+SIZQ0peJEnoLJ7W+gCu K58A== X-Gm-Message-State: APjAAAUEnEhMGJ/LA9JmQihFYqbQoigYmBqiGdy2UDjmX7hXBU1nTLLQ DKoFAj3o3fjkM2gUYDZw6jYurVP5Gx4= X-Google-Smtp-Source: APXvYqyBd2/I0tXX4noU4lDQlZTLLHBmM8C+EZv5ncbqdM0aXTOSbeFwLexGIrRKRyYObsG7de6C4g== X-Received: by 2002:a0c:ad02:: with SMTP id u2mr30430167qvc.90.1558465291570; Tue, 21 May 2019 12:01:31 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id r16sm7730095qkk.36.2019.05.21.12.01.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 12:01:29 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hTA0u-0007DE-7z; Tue, 21 May 2019 16:01:28 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 6/7] cbuild: Do not require yaml to always be installed Date: Tue, 21 May 2019 16:01:23 -0300 Message-Id: <20190521190124.27486-7-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190521190124.27486-1-jgg@ziepe.ca> References: <20190521190124.27486-1-jgg@ziepe.ca> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jason Gunthorpe We only need this for the travis related commands. Signed-off-by: Jason Gunthorpe --- buildlib/cbuild | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildlib/cbuild b/buildlib/cbuild index a0b4a7e3e52117..2bd869cc28cbe1 100755 --- a/buildlib/cbuild +++ b/buildlib/cbuild @@ -52,7 +52,6 @@ import shutil import subprocess import sys import tempfile -import yaml from contextlib import contextmanager; project = "rdma-core"; @@ -239,6 +238,7 @@ class travis(APTEnvironment): _yaml = None; def get_yaml(self): + import yaml if self._yaml: return self._yaml; @@ -696,6 +696,7 @@ def copy_abi_files(src): shutil.copy(cur_fn, ref_fn); def run_travis_build(args,env): + import yaml with private_tmp(args) as tmpdir: os.mkdir(os.path.join(tmpdir,"src")); os.mkdir(os.path.join(tmpdir,"tmp")); From patchwork Tue May 21 19:01:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10954413 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EDB13924 for ; Tue, 21 May 2019 19:01:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCF4028AB0 for ; Tue, 21 May 2019 19:01:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D184D28AB8; Tue, 21 May 2019 19:01:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B7EF28AB0 for ; Tue, 21 May 2019 19:01:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729311AbfEUTBd (ORCPT ); Tue, 21 May 2019 15:01:33 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:40546 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729293AbfEUTBd (ORCPT ); Tue, 21 May 2019 15:01:33 -0400 Received: by mail-qt1-f194.google.com with SMTP id k24so21824543qtq.7 for ; Tue, 21 May 2019 12:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZnLAvF2TQmvzir8YcJdEbcp+YHhChloz4RuzwqEwBLk=; b=mCuLB0ItSaWYGP2Ev6cxareXxbiE4ht4Bmha7aZ0bheoQeWiLRjSTJJJGVh2Es9KcS /06bd8zr/ICo+iVD3VMnDP66qTyZH+LnOn+o8NOJe47nZh+N+g9TuIK2aMn9XSuU6fMM 9jLsZY19mwyO3IJzlXEeZzLONRLPbBZwIbSEAFlGWRTV6eSCKzJ2ssoRacxEwwchTsNd 8i7J4o3mWfByet4pjrpPN/qEzeTxJDLohyhxekKqxnZGzQQM496ZTyPlwX2tpxB4U4nF eTrWyqgaEa+rh0qHeE4nX0yEfUxn+btNx1ZOaggDbBHRCVXbebkUqy01/zR6r6I3cyh8 FqbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZnLAvF2TQmvzir8YcJdEbcp+YHhChloz4RuzwqEwBLk=; b=KA0KAGpvf5NPmsl+MPezaBatHcoc6V9T2TpI2oWcCbzKsRbiqerJH9gcrOoNoSml8k N0ts5pbaBikml7bjSi2B4UzEcejYlKfaWnlGdzNjOIakgOM5M3mdNYBivfAFwf1T7S5U 9esx6IY6NpyqN9dVABEou/hjVrsfbtGpew9MKsnWRWrv18h5atHSA1GtUSFf51rN0wnw 9xs0qVBZOTeoAnZ+fizyLgkN9iUCxjKfIQZaf8VeQMAypj2EoMykQ71eVskf3GX3QZLO jMrTI/Ug/FDFJODcZrS6ryjw75bQxAPTVSAArxDRStiALVct2/UN2XAGgAfLFsclYcf2 sMjw== X-Gm-Message-State: APjAAAWMdegVt4GRGpCCLOHgbFytm2GOlGa+WRZ6L+Tqgt/aizjQhVQS Rw4+iQ5g2OsPM4ns7An/ozcT1oSDP6E= X-Google-Smtp-Source: APXvYqzNqhzwNcGaGX2PLAVm4y6eM+y0WfyvIgTuf3F/j0X//pb2HBmQqFObfo+vBABSsJpVQw5gsg== X-Received: by 2002:a0c:ad02:: with SMTP id u2mr30430214qvc.90.1558465291923; Tue, 21 May 2019 12:01:31 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id j64sm3892116qke.92.2019.05.21.12.01.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 12:01:29 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hTA0u-0007DK-91; Tue, 21 May 2019 16:01:28 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 7/7] build: Expose the cbuild machinery to build the release .tar.gz Date: Tue, 21 May 2019 16:01:24 -0300 Message-Id: <20190521190124.27486-8-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190521190124.27486-1-jgg@ziepe.ca> References: <20190521190124.27486-1-jgg@ziepe.ca> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jason Gunthorpe cbuild makes this tar file as does the github-release script, just have it in one place. Signed-off-by: Jason Gunthorpe --- buildlib/cbuild | 55 ++++++++++++++++++++++++++++++++--------- buildlib/github-release | 7 +----- 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/buildlib/cbuild b/buildlib/cbuild index 2bd869cc28cbe1..7b0b9a9de0ed44 100755 --- a/buildlib/cbuild +++ b/buildlib/cbuild @@ -510,21 +510,12 @@ def get_tar_file(args,tarfn,pandoc_prebuilt=False): # When the OS does not support pandoc we got through the extra step to # build pandoc output in the travis container and include it in the - # tar. This is similar to what buildlib/github-release does. + # tar. if not args.use_prebuilt_pandoc: subprocess.check_call(["buildlib/cbuild","make","travis","docs"]); - tmp_tarfn = os.path.join(os.path.dirname(tarfn),"tmp.tar"); - get_tar_file(args,tmp_tarfn,False); - - subprocess.check_call([ - "tar", - "-rf",tmp_tarfn, - "build-travis/pandoc-prebuilt/", - "--xform","s|build-travis/pandoc-prebuilt|%sbuildlib/pandoc-prebuilt|g"%(prefix)]); - with open(tarfn,"w") as F: - subprocess.check_call(["gzip","-9c",tmp_tarfn],stdout=F); - os.unlink(tmp_tarfn); + cmd_make_dist_tar(argparse.Namespace(BUILD="build-travis",tarfn=tarfn, + script_pwd="",tag=None)); def run_rpm_build(args,spec_file,env): with open(spec_file,"r") as F: @@ -904,6 +895,45 @@ def cmd_build_images(args): tmpdir]); docker_cmd(args,*opts); +# ------------------------------------------------------------------------- +def args_make_dist_tar(parser): + parser.add_argument("BUILD",help="Path to the build directory") + parser.add_argument("--tarfn",help="Output TAR filename") + parser.add_argument("--tag",help="git tag to sanity check against") +def cmd_make_dist_tar(args): + """Make the standard distribution tar. The BUILD argument must point to a build + output directory that has pandoc-prebuilt""" + ver = get_version(); + + if not args.tarfn: + args.tarfn = "%s-%s.tar.gz"%(project,ver) + + # The tag name and the cmake file must match. + if args.tag: + assert args.tag == "v" + ver; + + with private_tmp(args) as tmpdir: + tmp_tarfn = os.path.join(tmpdir,"tmp.tar"); + + prefix = "%s-%s/"%(project,get_version()); + subprocess.check_call(["git","archive", + "--prefix",prefix, + "--output",tmp_tarfn, + "HEAD"]); + + # Mangle the paths and append the prebuilt stuff to the tar file + if args.BUILD: + subprocess.check_call([ + "tar", + "-C",os.path.join(args.script_pwd,args.BUILD,"pandoc-prebuilt"), + "-rf",tmp_tarfn, + "./", + "--xform",r"s|^\.|%sbuildlib/pandoc-prebuilt|g"%(prefix)]); + + assert args.tarfn.endswith(".gz") or args.tarfn.endswith(".tgz"); + with open(os.path.join(args.script_pwd,args.tarfn),"w") as F: + subprocess.check_call(["gzip","-9c",tmp_tarfn],stdout=F); + # ------------------------------------------------------------------------- def args_docker_gc(parser): pass; @@ -944,6 +974,7 @@ if __name__ == '__main__': # This script must always run from the top of the git tree, and a git # checkout is mandatory. git_top = subprocess.check_output(["git","rev-parse","--show-toplevel"]).strip(); + args.script_pwd = os.getcwd(); os.chdir(git_top); args.func(args); diff --git a/buildlib/github-release b/buildlib/github-release index f95d40f5ee51ee..8fc536fb8b1074 100755 --- a/buildlib/github-release +++ b/buildlib/github-release @@ -3,10 +3,5 @@ set -e if [[ $TRAVIS_TAG == v* ]] && [ "$TRAVIS_OS_NAME" = "linux" ]; then - # Let's create release for vX tags only. - # Strip the v from the TRAVIS_TAG for our prefix and output items - REL_TAG=`echo $TRAVIS_TAG | sed -e 's/^v//'` - git archive --prefix rdma-core-$REL_TAG/ --output rdma-core-$REL_TAG.tar $TRAVIS_TAG - tar -rf rdma-core-$REL_TAG.tar build-travis/pandoc-prebuilt/ --xform "s|build-travis/pandoc-prebuilt|rdma-core-$REL_TAG/buildlib/pandoc-prebuilt|g" - gzip -9 rdma-core-$REL_TAG.tar + buildlib/cbuild make-dist-tar --tag "$TRAVIS_TAG" build-travis fi