Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp337189ybj; Thu, 19 Sep 2019 15:19:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIcbuTWXle0e1P6S2/vRI+KqjnywQKd382oEWp9k2pX+xyI9p9vcrBrEiiwlDGbAU9ZpbC X-Received: by 2002:a50:d6db:: with SMTP id l27mr18892641edj.164.1568931540753; Thu, 19 Sep 2019 15:19:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568931540; cv=none; d=google.com; s=arc-20160816; b=O6o5dcupEG3QmnLv3fkoQoTbdtcckGksuV5YVykn0rAVqWt5SgVbdjZuhbeZxC4Y6X YoSOgL/TkyB6YFHewkGa6B1DTRx7E+mqv+WFTf6I0Jcu/3YxYFoZ7znczVcP9JkfAQk4 jCGWPPvPc/TgFLhao41RZajbjL9/mvnEDIuVnX51AbC6sDCaQGMWE1vyGqC3OpHpMY0y 56ztgZjU5nmQIp1nM4bxQVgNg9t0P0gMrcGXKoZbKfdIY1AzdWhUaWiKI5MMbRwLnhW3 kk0F3LqQHYuXiURWKnVNYOyxPH2SNX+nRqNe5+gFzxO5WrCZhk4lI53OVWEyemQLSVD6 RWQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=8tiLUzdYi4ITB45WucLNW+ND66QoXoPlA91lr3mWY0I=; b=UcbDlAQtBwJSocjvLj3l2pe9Eos2EHOJZl6aGbLRxVuBW16dZJvfmJzb94hSEF+1ss J9Vyh6IsIlkS5ImAdCi6TwMwpfKkiC7AxCWo68pMas+Ti3tEt2i1aK6xB1JW27RL1/+U 7O2vnihf/IsOn9UnslIdm1zswoMDk3wcRMfv0+O6nu/CEsiD0Fk7bwUTaq3y1MVrzzxf 8v7M34Zoi34CwQ1wgPEE4UeSBMFkQw+jPmEg/+10ArHIlyKoFKkvzvFC0su7zoH2UMrG OYY4MQfCb2u9peiUSyBbjDbZZupwBIFnYmGmGeE9EoHkb+eEoPwxgL7pDDmA5GaW+UVs ioIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sbqDMqvc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ot41si1599650ejb.215.2019.09.19.15.18.37; Thu, 19 Sep 2019 15:19:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sbqDMqvc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404569AbfISUCx (ORCPT + 99 others); Thu, 19 Sep 2019 16:02:53 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:37015 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404554AbfISUCw (ORCPT ); Thu, 19 Sep 2019 16:02:52 -0400 Received: by mail-qk1-f196.google.com with SMTP id u184so4769393qkd.4; Thu, 19 Sep 2019 13:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8tiLUzdYi4ITB45WucLNW+ND66QoXoPlA91lr3mWY0I=; b=sbqDMqvcvX3x6cU1Bdz+6qPbXVu92Hlw7FpYhWcmNu2nb76PWtUJQnkwE98baOLrmI 0MY5otAgmrOc07A8Yw0QDg6TYwqi+mvnIXIpvyl6ZrblMCiJXvmVj9lbRaDSVNV+QHG4 67cVb+vU6c/ZsY1HTtHGdmiK6rFizS7IbGORW4k/+nBbjcSQiGBXcGYtSYOW62F56AGF KTtEt9mAPo7t9Y4oJBowYtKY56XThUbC2h6tYPXdFXFriLnIeZRzsQoKFno5YPPTQq/7 CElIzcWjG2FWQf2DczVSoq2MHQxMYDCoemtFPqe2+IrN1xGdhKayesdkq08nUYx3ZwOQ WysA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8tiLUzdYi4ITB45WucLNW+ND66QoXoPlA91lr3mWY0I=; b=lhHDaapT72xnTD1PFTZvH6rcMz/4SQ6Bb4sZLixz/vDTHUqzbImYkB17pXYFMJXBzy zcKqv7KqFM69FWIKxbWuYY9O4WjXd1JO25HtGEZF/xEFAE6ZkTjTYM6gPJH8ahzVj26m H7mFeva/pCmzUEnTVnrwnnZyXsgpTLwAQCcjnTq7qv/FEpkwz1RotZywGv/CTTkXKFxF eevnZjIR3OuAqNOdRYhUjEgd4B396ND9DhpPziG5Gd0gcT3u4NenjB2hHrbn7zJf3dLH c/mZ4RG++oFUsW9XgJia50rzpsZdMpYkHqj447NmYMWzz+F4ZefFqDIvb1Wk3hNwvGwM 1KRA== X-Gm-Message-State: APjAAAWap6OViTOZDrOKTCeSr6gXXkiXY0toFNPWoevLXQkwC6ogFrfK 8zg5E/Wx1wTAT6RlE7xYqh11denF3pgATfNdfes= X-Received: by 2002:a05:620a:119a:: with SMTP id b26mr4913032qkk.39.1568923371419; Thu, 19 Sep 2019 13:02:51 -0700 (PDT) MIME-Version: 1.0 References: <20190919160518.25901-1-ivan.khoronzhuk@linaro.org> In-Reply-To: <20190919160518.25901-1-ivan.khoronzhuk@linaro.org> From: Andrii Nakryiko Date: Thu, 19 Sep 2019 13:02:40 -0700 Message-ID: Subject: Re: [PATCH bpf] libbpf: fix version identification on busybox To: Ivan Khoronzhuk Cc: Alexei Starovoitov , Daniel Borkmann , Martin Lau , Andrii Nakryiko , Yonghong Song , Networking , bpf , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 19, 2019 at 11:22 AM Ivan Khoronzhuk wrote: > > It's very often for embedded to have stripped version of sort in > busybox, when no -V option present. It breaks build natively on target > board causing recursive loop. > > BusyBox v1.24.1 (2019-04-06 04:09:16 UTC) multi-call binary. \ > Usage: sort [-nrugMcszbdfimSTokt] [-o FILE] [-k \ > start[.offset][opts][,end[.offset][opts]] [-t CHAR] [FILE]... > > Lets modify command a little to avoid -V option. > > Fixes: dadb81d0afe732 ("libbpf: make libbpf.map source of truth for libbpf version") > > Signed-off-by: Ivan Khoronzhuk > --- > > Based on bpf/master > > tools/lib/bpf/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile > index c6f94cffe06e..a12490ad6215 100644 > --- a/tools/lib/bpf/Makefile > +++ b/tools/lib/bpf/Makefile > @@ -3,7 +3,7 @@ > > LIBBPF_VERSION := $(shell \ > grep -oE '^LIBBPF_([0-9.]+)' libbpf.map | \ > - sort -rV | head -n1 | cut -d'_' -f2) > + cut -d'_' -f2 | sort -r | head -n1) You can't just sort alphabetically, because: 1.2 1.11 should be in that order. See discussion on mailing thread for original commit. > LIBBPF_MAJOR_VERSION := $(firstword $(subst ., ,$(LIBBPF_VERSION))) > > MAKEFLAGS += --no-print-directory > -- > 2.17.1 >