Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp964605iob; Fri, 13 May 2022 17:56:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTr7f0CeyF/Rj0KwbN0FLQpu8ZXUqkF+MzigYE8xuzTXmQ2/c9d/a6/Hyxzi/z8m5hPJAF X-Received: by 2002:a1c:2b86:0:b0:392:ae97:2fec with SMTP id r128-20020a1c2b86000000b00392ae972fecmr6598967wmr.165.1652489776927; Fri, 13 May 2022 17:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652489776; cv=none; d=google.com; s=arc-20160816; b=S7Ig/oZttJzF+qTbMGvWmgoaN2G2H0WaBqfHFjaN3ouhnFqbQKwJLo0FZTMpE8O0EV FsF7J3LSwEkQrXniIbfMxeIUguFNeFNzdQy0+C8mzufDHlLjj9LPOcM+AQfwk8Ino71t N2REPkNHC8gH9aeNrnU8Kwku3gJ4CrRxrpewfGe2KZxFiCTfslb6CmHwwn8mIbQI/v22 XUizqUsAJ/b1ZzxlWDFOSeNmMn4nsc95HZ4MNl0jMk6kA2j21Wd1cBnLntIQ1h4O/QNt C3oEQRMtzUcCS0blZ5tRxfxoC4ehYZSjY2kenbuQ+Tw0UG86ohdvHJC1FfIlJN4c0/V7 o4FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=PLHfkBps8/NN/F93wiTb1I9xCzDthCPlSjntIH72rDE=; b=RhoK3Xe9dVfJ01974xMJJaSATswk49TZDZOoSxZID4esm/i4GTg/affJnhLxBIbyS7 e9eRDV/da2N9T/U5b0tUMgs3Ds9puB2SKvEVJUHVj5sUnSNS8gIoca0YfH1XS9GsXpxK +CarLENKmej54HUgyZ6cIghCWlgVMHb9viKKWAw8QIeLC5Wv8wMgByIbgG8DWMrIIi4R mz2suTspcwy3AJhjNeUYImOjmfCwJIdMhvxWBNCe2wEtDB/NMWahNI2yRWUlEGRHRSle d7FrdGjcby9swumFKEt9zXeNIzunpoofYRywJUaqdPXpQTQjCaqyW23x+qxzviBwNOfQ 8M8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=I8afDsMF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c4-20020a5d4f04000000b0020ace36394dsi3675141wru.230.2022.05.13.17.56.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 17:56:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=I8afDsMF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 65F2F308848; Fri, 13 May 2022 16:31:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345691AbiEMAl0 (ORCPT + 99 others); Thu, 12 May 2022 20:41:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232196AbiEMAlX (ORCPT ); Thu, 12 May 2022 20:41:23 -0400 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F4E85FF07 for ; Thu, 12 May 2022 17:41:21 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id ij27-20020a170902ab5b00b0015d41282214so3508310plb.9 for ; Thu, 12 May 2022 17:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=PLHfkBps8/NN/F93wiTb1I9xCzDthCPlSjntIH72rDE=; b=I8afDsMFlizjC2WkKw9nEOj2vMJgklTATaw1Hsa/SWTOmJqlD7HHRMFbRFXtiK5hKb eWR68srOtf34zMu8hRlFofRBQy/Kzvf9bIK5KmrMoPCtMhuNUIreuIDMCS0+HR7A97qA 4norc+7XY3Ry8c2YsW8H6ig1JhvGZVoetaN6esBwKE9GsFTgHy0aQb6TWGqWqT5+iagi u0NOcqhn2xj8lDeq6QVIGMfypdzYQUXj/zwLC7cAmZdjvcQbS1bZDx2o2Swcm1uJ7M+H MVP3texpB2djiZrBiw8E2Hcwgk3Wb3yQENmoEoJRD1eEtwku11QHqpbk9WVB9zxfdH3a fmmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=PLHfkBps8/NN/F93wiTb1I9xCzDthCPlSjntIH72rDE=; b=58WDPXfm/a6dZXXAlR51CTc68PDBDF3a4gzsPunzxRHDAxezLeZSWW+5UiZN7zAAGD 38FCs/sico348mXkcehZ/cmVFXp3SKPnDCnZOwDnMesz+xIbs4aTuaKXM5WuTAV/AXS+ n0wigJxjrHkfKciQyRKY88gq9V6Fw5a88RBvv0L4RR7tLLZqJzi4Tgw6B6AXaDTNbbWv jBCUU5rkMZm0jMH/Oe6ZnbAq484FZXBxjmo4VagoQKD15Od4jHRdMAz829ZaRzirwaT7 IOqurS+V1ruoL5m45baYoGf58a0rOMZeEjMUHlHwWvW8KiqpUB3viM3JpemUO/8gFqw3 9vhg== X-Gm-Message-State: AOAM531u2y1SD8NcXhGUemUrTvyLvmMqXrf/2S544u3A8VnOFhibVrfB /3x5nSWVtxpVimXtIdNqDnPtqDVn1qWFldXe X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2327]) (user=yosryahmed job=sendgmr) by 2002:a17:90b:4b42:b0:1dc:15f8:821b with SMTP id mi2-20020a17090b4b4200b001dc15f8821bmr13529101pjb.131.1652402480734; Thu, 12 May 2022 17:41:20 -0700 (PDT) Date: Fri, 13 May 2022 00:41:17 +0000 Message-Id: <20220513004117.364577-1-yosryahmed@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.36.0.550.gb090851708-goog Subject: [PATCH bpf-next] selftests/bpf: fix building bpf selftests statically From: Yosry Ahmed To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song Cc: John Fastabend , KP Singh , Hao Luo , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org bpf selftests can no longer be built with CFLAGS=-static with liburandom_read.so and its dependent target. Filter out -static for liburandom_read.so and its dependent target. Signed-off-by: Yosry Ahmed --- tools/testing/selftests/bpf/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 6bbc03161544..4eaefc187d5b 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -168,14 +168,17 @@ $(OUTPUT)/%:%.c $(call msg,BINARY,,$@) $(Q)$(LINK.c) $^ $(LDLIBS) -o $@ +# If the tests are being built statically, exclude dynamic libraries defined +# in this Makefile and their dependencies. +DYNAMIC_CFLAGS := $(filter-out -static,$(CFLAGS)) $(OUTPUT)/liburandom_read.so: urandom_read_lib1.c urandom_read_lib2.c $(call msg,LIB,,$@) - $(Q)$(CC) $(CFLAGS) -fPIC $(LDFLAGS) $^ $(LDLIBS) --shared -o $@ + $(Q)$(CC) $(DYNAMIC_CFLAGS) -fPIC $(LDFLAGS) $^ $(LDLIBS) --shared -o $@ $(OUTPUT)/urandom_read: urandom_read.c urandom_read_aux.c $(OUTPUT)/liburandom_read.so $(call msg,BINARY,,$@) - $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.c,$^) \ - liburandom_read.so $(LDLIBS) \ + $(Q)$(CC) $(DYNAMIC_CFLAGS) $(LDFLAGS) $(filter %.c,$^) \ + liburandom_read.so $(LDLIBS) \ -Wl,-rpath=. -Wl,--build-id=sha1 -o $@ $(OUTPUT)/bpf_testmod.ko: $(VMLINUX_BTF) $(wildcard bpf_testmod/Makefile bpf_testmod/*.[ch]) -- 2.36.0.550.gb090851708-goog