From patchwork Wed Jan 16 17:43:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_D=C3=ADaz?= X-Patchwork-Id: 155738 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp937118jaa; Wed, 16 Jan 2019 09:44:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN4JbiUc3yW+v0Ze+9iA4MmlV5npBOmc4aRMSZXfowNdwm/69Rhzjye4ONQJq+Ljy8fvSWzS X-Received: by 2002:a63:c42:: with SMTP id 2mr9982214pgm.372.1547660652670; Wed, 16 Jan 2019 09:44:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547660652; cv=none; d=google.com; s=arc-20160816; b=jQE180TzEsulk534f3CqXwshwayJsiSuzk9h0q7ilLjbJ/3l/D9q5YNSQgi7+VJQfn k0X+K5KKrxocneXecBGgvZMCirb/xLVtaWpXhiPO1O/BtwM8PX75ai7s0L6dIHHznr2Y yDNjRz5OxYP5vMh73Spp9+gS9pMamPASLwnHnAZgRq9/PH0quOnc6IxxeMOm1LLk2LKn ZA61A8u0LYAF4Aaf1a79XDEc+FN1WDgYYc8xtvwMozMnJkD61bqB9crr+qGZTynqf9Kd drdKQ2nqQTGYrbR7ZALwhaBg3mN4SXNAl6xkKQdluCDKZYiju3bbPNfon5fsvdP9klyw +5mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=CjETfAnfRxtbE9MWGkPp2aHU9Y+vwQE7qZ1JQ/QEJmM=; b=zFHWFJO7XMhqJXHNUIF7aPxPcqQtEdXLGaAMWDSPZbNu01qIeKL80F2tWY5s7WJAxF E9w/htmIHbiyjk4uex0HJ6CqOc1NWXXAz2LXxcd6uqbNIMqK6D39F2hRlSt8NIbg1TwU KR/DbvYZFFIyBShuTN3l+POGXPj7IqvlPdhDLs0td1cE+YgWINEKEzRKvl0AS2qYzBgV aqcbP7gmb3kGCdyR4NXqTWZkS4G2bCrrVkg+IBMuIoxwP8chsH54aP9PvTOm9PJneQ0a boQMslS3w4kkfL74usuEy4x+m2ICUWvDbdP3WQiRdOuh8T5PMgBOe90CIhPOVz8GyTv3 suDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SYJt/2jF"; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69si6942173pla.75.2019.01.16.09.44.12; Wed, 16 Jan 2019 09:44:12 -0800 (PST) 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=@linaro.org header.s=google header.b="SYJt/2jF"; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727505AbfAPRoL (ORCPT + 22 others); Wed, 16 Jan 2019 12:44:11 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:42802 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbfAPRoL (ORCPT ); Wed, 16 Jan 2019 12:44:11 -0500 Received: by mail-ot1-f67.google.com with SMTP id v23so8468504otk.9 for ; Wed, 16 Jan 2019 09:44:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=CjETfAnfRxtbE9MWGkPp2aHU9Y+vwQE7qZ1JQ/QEJmM=; b=SYJt/2jFty9uyfCQ+VSpn/7urDoH9zQ8wkSsk946KPg8eE+owKpIT4Z1tFPhbM4Ok4 4Vp0rRlVH1jiKTXHbIkmRu8pBb8OKOiNXN3pgBbD7d2TtVRX/FX3/64X+Sv3ihvO524W yt/6XADt7d/tSDDPXihdxAJj9bP5hWC1ToYIo= 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; bh=CjETfAnfRxtbE9MWGkPp2aHU9Y+vwQE7qZ1JQ/QEJmM=; b=meDK4F46EiykoUpqx/omVRWmS0zS+W+FVRGBamhyxt/jHznLnNcV8zNURKbtiD2Hae ED1/6MhvSaGp+WlOygR3RAa66NabZD1EOxDSoYFNW1myUEzOeaEQg9mTno9v4iC7Oerj 4b64yXJGqCmDLzBusKe7Dm70EnWEtKKK5/2zsyvUh0j0A8VpbgrLNKTbL8hIALPKt2KZ ZutQx0jBMn4kByZmlg64KJaXIcS7ZnuDlc7VDIwpcPDaz56MDlLeVVdTA8we7+fIxt8L COmXVBJhDxygGEoRurQsYE+nnhXx2SccCNrD+VCOfXqC+iAM5uSMETNi+2q7tGSy4JTl RDsw== X-Gm-Message-State: AJcUukcDTehWl3+EsmCOMmgOUZGOqd12THLGq8R6lIXi9deBbOlgEPzJ choYKXypkgR/Cj8WOmavOoSUqQ== X-Received: by 2002:a9d:6191:: with SMTP id g17mr6481114otk.56.1547660650423; Wed, 16 Jan 2019 09:44:10 -0800 (PST) Received: from alago.cortijodelrio.net (CableLink-189-218-30-19.Hosts.InterCable.net. [189.218.30.19]) by smtp.googlemail.com with ESMTPSA id m129sm3152973oif.50.2019.01.16.09.44.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 09:44:09 -0800 (PST) From: =?utf-8?q?Daniel_D=C3=ADaz?= To: shuah@kernel.org Cc: Fathi Boudra , Denys Dmytriyenko , linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST FRAMEWORK), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/4] selftests: lib: allow to override CC in the top-level Makefile Date: Wed, 16 Jan 2019 11:43:17 -0600 Message-Id: <20190116174320.14938-1-daniel.diaz@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fathi Boudra Relax CC assignment to allow to override CC in the top-level Makefile. Signed-off-by: Denys Dmytriyenko --- tools/testing/selftests/lib.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 8b0f16409ed7..0f9c47eaaa6f 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -1,6 +1,6 @@ # This mimics the top-level Makefile. We do it explicitly here so that this # Makefile can operate with or without the kbuild infrastructure. -CC := $(CROSS_COMPILE)gcc +CC ?= $(CROSS_COMPILE)gcc ifeq (0,$(MAKELEVEL)) OUTPUT := $(shell pwd) From patchwork Wed Jan 16 17:43:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_D=C3=ADaz?= X-Patchwork-Id: 155740 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp937648jaa; Wed, 16 Jan 2019 09:44:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN54BTjXPg5no8jC1xxiY8QEktF2X9yqUaEFg/IhR9RxxPD4gV3UECzBg3U5ezVZqrXvnjl4 X-Received: by 2002:a62:6ac8:: with SMTP id f191mr10829585pfc.13.1547660685303; Wed, 16 Jan 2019 09:44:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547660685; cv=none; d=google.com; s=arc-20160816; b=0E8FpekoBLepCmtVB05nJGOlSOHzcV+Jc4ouZVtj1DOGtErWoTY7qzTWwbX7yOEoTJ AELfyFHDsnlXnlzm43A2BrOUaghCaC46uNbUtaNJxZt80wVZNHchkh3F9mg+6HgAOfKJ Dr1kr9LVLpW7pbm0hjgobEVHT9ASzVkKyAyyaJX98ctMWQNm3dUV3UZPxlSIB0FvVzop jzXIUKXZbBKH1GNZl3jxJgZxN0k8eI8ibGw80xOVXNyoOmZFSODEeihUHjq+8bAdpCo4 PnwMy1CNei7S/ZmmxTnCKgCKrk1fYpequTW/d9u+zVra5OJ7/phhmvDhq7gMpsZJbHCu pBBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DBgikpoYDKLEsgn7BLzA/++54/fMRAvNSrEOYwzsOh8=; b=05KdgQMCUKKe2+vEExgdjmlu4KewQHt85fsQVXx08IbnnGMtyAnZFWP6aAURgG8czl 5Pht5l7sIj0nYAdZFZrXLDhD1F0Y83+8XoeZsFYQRBuRrN//DK3iBAQ57lC+L8SWTzVf vaWSkKSJkhqJk5iagakMYuHe7SMqKLvSsRETw3Y7YqjjjzHpbSfQ5GosOkrjZtt3zUMK TmKbOoTYxF4yFcy13aJxv4a6E7u2wtnXT4YcIn9nH97R/0D7q3eX9QZyqm9LFqL2mF5V HGbge/Hb8lwSDOB3oVqiZrQdCl+Vc6EnWVlVMGDSF/HE7NpqQFMZ5Q5qsYXyifaRnUTL aGEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e7h7QqHz; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j39si6895952plb.272.2019.01.16.09.44.44; Wed, 16 Jan 2019 09:44:45 -0800 (PST) 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=@linaro.org header.s=google header.b=e7h7QqHz; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727556AbfAPRoo (ORCPT + 22 others); Wed, 16 Jan 2019 12:44:44 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:42635 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726741AbfAPRon (ORCPT ); Wed, 16 Jan 2019 12:44:43 -0500 Received: by mail-oi1-f193.google.com with SMTP id w13so3862105oiw.9 for ; Wed, 16 Jan 2019 09:44:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DBgikpoYDKLEsgn7BLzA/++54/fMRAvNSrEOYwzsOh8=; b=e7h7QqHzW42AQDkJh7c6/QoNKvD63z2+M5xmA7fgyLu1+/7J6PSLFK+51KLCPqi4YD f1ToYgfo6MeyVl2XR77cwkDxyMNKNVZ/ll40is4ZbqMdjvbLGkNp6DBIesrx/5021ON1 wz9ahbUNGzS+YKi8f1rzhl1raNff65vVdqyHE= 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=DBgikpoYDKLEsgn7BLzA/++54/fMRAvNSrEOYwzsOh8=; b=ba/Vru2UnqgnZQW34ZV2JRtNKx5fLSsLyfO8IISEjqldtGLg+f7UtuOMxYkXTsiX3V P9WNyZIlZBOFxZIxEcJGJBqkGIAa2CDvKCPqYvjKHNexwmCnbdtGeRwVslHOTj3CdMZ8 ATAgFWIrkm4/BDGfnckFnv1PLNbQy+e+ac6O+aH+TlHYOrs2x3m7Sto84Yrjies2ISya lWoDG7ZXrA/ArzayZLjIgleme1m2WWaSsb7qJFd3A35BgOtN+OdWrdfey5PbjdH6EYeL tomTnbJs1v5+eUOPPWuLJS+TgBHb/zxdM6H4VTpekMQpuVOA7ORqayrbvQNhMUWV1pK1 ZwSQ== X-Gm-Message-State: AJcUukfMToetI3PmqkacwOJm7DJs4d4Ax674HbQ/Jh9OkcukQThfT2yP n4lkG0kAsPdRKIQoIR6OoWDrtcLUx8ru+Q== X-Received: by 2002:aca:3209:: with SMTP id y9mr4174552oiy.198.1547660682542; Wed, 16 Jan 2019 09:44:42 -0800 (PST) Received: from alago.cortijodelrio.net (CableLink-189-218-30-19.Hosts.InterCable.net. [189.218.30.19]) by smtp.googlemail.com with ESMTPSA id m129sm3152973oif.50.2019.01.16.09.44.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 09:44:41 -0800 (PST) From: =?utf-8?q?Daniel_D=C3=ADaz?= To: shuah@kernel.org Cc: Fathi Boudra , Kees Cook , Andy Lutomirski , Will Drewry , linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST FRAMEWORK), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 3/4] selftests: seccomp: use LDLIBS instead of LDFLAGS Date: Wed, 16 Jan 2019 11:43:19 -0600 Message-Id: <20190116174320.14938-3-daniel.diaz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190116174320.14938-1-daniel.diaz@linaro.org> References: <20190116174320.14938-1-daniel.diaz@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fathi Boudra seccomp_bpf fails to build due to undefined reference errors: aarch64-linaro-linux-gcc --sysroot=/build/tmp-rpb-glibc/sysroots/hikey -O2 -pipe -g -feliminate-unused-debug-types -Wl,-no-as-needed -Wall -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lpthread seccomp_bpf.c -o /build/tmp-rpb-glibc/work/hikey-linaro-linux/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf /tmp/ccrlR3MW.o: In function `tsync_sibling': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1920: undefined reference to `sem_post' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1920: undefined reference to `sem_post' /tmp/ccrlR3MW.o: In function `TSYNC_setup': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1863: undefined reference to `sem_init' /tmp/ccrlR3MW.o: In function `TSYNC_teardown': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1904: undefined reference to `sem_destroy' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1897: undefined reference to `pthread_kill' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1898: undefined reference to `pthread_cancel' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1899: undefined reference to `pthread_join' /tmp/ccrlR3MW.o: In function `tsync_start_sibling': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create' /tmp/ccrlR3MW.o: In function `TSYNC_siblings_fail_prctl': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1978: undefined reference to `sem_wait' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1990: undefined reference to `pthread_join' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1992: undefined reference to `pthread_join' /tmp/ccrlR3MW.o: In function `tsync_start_sibling': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create' /tmp/ccrlR3MW.o: In function `TSYNC_two_siblings_with_ancestor': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2016: undefined reference to `sem_wait' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2032: undefined reference to `pthread_join' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2034: undefined reference to `pthread_join' /tmp/ccrlR3MW.o: In function `tsync_start_sibling': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create' /tmp/ccrlR3MW.o: In function `TSYNC_two_sibling_want_nnp': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2046: undefined reference to `sem_wait' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2058: undefined reference to `pthread_join' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2060: undefined reference to `pthread_join' /tmp/ccrlR3MW.o: In function `tsync_start_sibling': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create' /tmp/ccrlR3MW.o: In function `TSYNC_two_siblings_with_no_filter': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2073: undefined reference to `sem_wait' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2098: undefined reference to `pthread_join' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2100: undefined reference to `pthread_join' /tmp/ccrlR3MW.o: In function `tsync_start_sibling': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create' /tmp/ccrlR3MW.o: In function `TSYNC_two_siblings_with_one_divergence': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2125: undefined reference to `sem_wait' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2143: undefined reference to `pthread_join' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2145: undefined reference to `pthread_join' /tmp/ccrlR3MW.o: In function `tsync_start_sibling': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create' /tmp/ccrlR3MW.o: In function `TSYNC_two_siblings_not_under_filter': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2169: undefined reference to `sem_wait' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2202: undefined reference to `pthread_join' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2227: undefined reference to `pthread_join' /tmp/ccrlR3MW.o: In function `tsync_start_sibling': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create' It's GNU Make and linker specific. The default Makefile rule looks like: $(CC) $(CFLAGS) $(LDFLAGS) $@ $^ $(LDLIBS) When linking is done by gcc itself, no issue, but when it needs to be passed to proper ld, only LDLIBS follows and then ld cannot know what libs to link with. More detail: https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html LDFLAGS Extra flags to give to compilers when they are supposed to invoke the linker, ‘ld’, such as -L. Libraries (-lfoo) should be added to the LDLIBS variable instead. LDLIBS Library flags or names given to compilers when they are supposed to invoke the linker, ‘ld’. LOADLIBES is a deprecated (but still supported) alternative to LDLIBS. Non-library linker flags, such as -L, should go in the LDFLAGS variable. https://lkml.org/lkml/2010/2/10/362 tools/perf: libraries must come after objects Link order matters, use LDLIBS instead of LDFLAGS to properly link against libpthread. Signed-off-by: Fathi Boudra --- tools/testing/selftests/seccomp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 Acked-by: Kees Cook diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile index fce7f4ce0692..1760b3e39730 100644 --- a/tools/testing/selftests/seccomp/Makefile +++ b/tools/testing/selftests/seccomp/Makefile @@ -9,7 +9,7 @@ BINARIES := seccomp_bpf seccomp_benchmark CFLAGS += -Wl,-no-as-needed -Wall seccomp_bpf: seccomp_bpf.c ../kselftest_harness.h - $(CC) $(CFLAGS) $(LDFLAGS) -lpthread $< -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) $< -lpthread -o $@ TEST_PROGS += $(BINARIES) EXTRA_CLEAN := $(BINARIES) From patchwork Wed Jan 16 17:43:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_D=C3=ADaz?= X-Patchwork-Id: 155741 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp937800jaa; Wed, 16 Jan 2019 09:44:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN6iOcmTusijgsqUj/TJvO4cl0Zh/v9sWEaK+fzAnP6Ecpn7QkDf1hgzzbo8N+VucFXBOXSW X-Received: by 2002:a63:8441:: with SMTP id k62mr9905690pgd.392.1547660696045; Wed, 16 Jan 2019 09:44:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547660696; cv=none; d=google.com; s=arc-20160816; b=fLoaqd2ZJfGlL+BpK5i0ZHnfgNsxV7VnVv/guvYeZID1C6mAgy08teKlqOjiTbvD+n hAdoWzWaJqTSfoh8224YhXMXmrl275YkHSiC4xhL5XBFs+npJYMd0tDVGcnhXz3AhFYm kBoMP4wFQSZ9x8g2CqH8o3v2zMCdWAAzxwEeX3TsEzQTHUqiCUGGmsquivSPQFdwvXvw bYvNGXLgWfktcFexmwpE/RwgKq7ndSHtkADoj6j1PPbqx8gusIaJ+RmiWGWjyLOix3B3 TA6t+u7M6MMG9L/GoV25jkAcRu2iLZD16N8FWQo3GMTNKK43OC4wAaf6UbvPFIYiCTZV C1LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9ntliFnHMh1UFNI4i4XDupue9MMU30iXjJz2OA1O7CA=; b=jKzbTyk58VQfd0SF1M1TWV5f9MIKW8FRrm6JlH3/0siWpsVOt9Y7raVdxbKjXUKFPB SiWgb5e0sDoyRGy/nzP4khquF2jKxpVEKhtpMHxym5n4zS5GEEom3VrGeTa628PppvLh 7aC0ZqX96Lk7vWC2RB5oVj37W2ddXtQdG82bu2nF18HkWLQXdqaQr+x9/aa0EIQ9z1Ur 2fENSshGKXVpq00LAFfE2/jccoBBewybEaTLdTcnyFTgVZSvWCYLxmtUJ6P6UizTP1Bi bNqXxpvRO/b2edYR/FJ9EbHlwmlMJLOyQ2Rq1OLsq102XoUQL35lydiXG/BwBNmd5nQI hDYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dE6LaPYL; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o195si6965391pfg.106.2019.01.16.09.44.55; Wed, 16 Jan 2019 09:44:56 -0800 (PST) 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=@linaro.org header.s=google header.b=dE6LaPYL; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727578AbfAPRoz (ORCPT + 22 others); Wed, 16 Jan 2019 12:44:55 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:41770 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726466AbfAPRoy (ORCPT ); Wed, 16 Jan 2019 12:44:54 -0500 Received: by mail-oi1-f193.google.com with SMTP id j21so3856653oii.8 for ; Wed, 16 Jan 2019 09:44:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9ntliFnHMh1UFNI4i4XDupue9MMU30iXjJz2OA1O7CA=; b=dE6LaPYLsHeS+ovTqbvwCuSHNPNEk3K5LNXIm2pin52MRe9AEshtvGhtUaT/VcQfsf gqmwwhDTOCtkpd/n+1VJpacJfROA6aQYHN47Ej0jJM0MRC0aRNxFpoKTvlhMc0Hw+Tfg I6g2EU3HqPqW0kO5J2e1pLJvs7+tWMc+RWpd0= 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=9ntliFnHMh1UFNI4i4XDupue9MMU30iXjJz2OA1O7CA=; b=Zz2gqrOkwIwspb+68dofTllE2Bld8W/Xuz2Noz6bhDzYB0pUbUk+cyFDwQ7T+vB3/K HbHymyF+JMfP1ZmltCVCqtQPzlrpPv6SI1FTexIWD7g6R97xt1/YlzMIblzSC6NJJogR JQRQawcNTVhvPfI8T51K2EhRlwICJzeZVK2cvfONxpAhyIcf2zEjIrmRuU0drgYfmdVY Np5muT7J14NN2nVM1Uv+yAEBSaqyUZ+c9Nn2d30AKM/jdttfwfMHqrhWRhAZpHgijPe/ 3TsUpX6UPcvUDGhvpF8fp4D5e5evJdFucKtaAlhcvLZ0UbNhKlUit7dHDaiVLroGyKGX ZP4A== X-Gm-Message-State: AJcUukfgEkGXxupYG/hxHFL+Gvo9NRkCi6D7LJnqIRANZ9g8kznk+3AI ZiGLdpoFohCkvZuHu1Bj5OyPLw== X-Received: by 2002:a54:488b:: with SMTP id r11mr595706oic.80.1547660693160; Wed, 16 Jan 2019 09:44:53 -0800 (PST) Received: from alago.cortijodelrio.net (CableLink-189-218-30-19.Hosts.InterCable.net. [189.218.30.19]) by smtp.googlemail.com with ESMTPSA id m129sm3152973oif.50.2019.01.16.09.44.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 09:44:52 -0800 (PST) From: =?utf-8?q?Daniel_D=C3=ADaz?= To: shuah@kernel.org Cc: Fathi Boudra , Denys Dmytriyenko , John Stultz , Thomas Gleixner , Stephen Boyd , linux-kernel@vger.kernel.org (open list:TIMEKEEPING, CLOCKSOURCE CORE, NTP, ALARMTIMER), linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST FRAMEWORK) Subject: [PATCH 4/4] selftests: timers: use LDLIBS instead of LDFLAGS Date: Wed, 16 Jan 2019 11:43:20 -0600 Message-Id: <20190116174320.14938-4-daniel.diaz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190116174320.14938-1-daniel.diaz@linaro.org> References: <20190116174320.14938-1-daniel.diaz@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fathi Boudra posix_timers fails to build due to undefined reference errors: aarch64-linaro-linux-gcc --sysroot=/build/tmp-rpb-glibc/sysroots/hikey -O2 -pipe -g -feliminate-unused-debug-types -O3 -Wl,-no-as-needed -Wall -DKTEST -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lrt -lpthread posix_timers.c -o /build/tmp-rpb-glibc/work/hikey-linaro-linux/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/timers/posix_timers /tmp/cc1FTZzT.o: In function `check_timer_create': /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/timers/posix_timers.c:157: undefined reference to `timer_create' /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/timers/posix_timers.c:170: undefined reference to `timer_settime' collect2: error: ld returned 1 exit status It's GNU Make and linker specific. The default Makefile rule looks like: $(CC) $(CFLAGS) $(LDFLAGS) $@ $^ $(LDLIBS) When linking is done by gcc itself, no issue, but when it needs to be passed to proper ld, only LDLIBS follows and then ld cannot know what libs to link with. More detail: https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html LDFLAGS Extra flags to give to compilers when they are supposed to invoke the linker, ‘ld’, such as -L. Libraries (-lfoo) should be added to the LDLIBS variable instead. LDLIBS Library flags or names given to compilers when they are supposed to invoke the linker, ‘ld’. LOADLIBES is a deprecated (but still supported) alternative to LDLIBS. Non-library linker flags, such as -L, should go in the LDFLAGS variable. https://lkml.org/lkml/2010/2/10/362 tools/perf: libraries must come after objects Link order matters, use LDLIBS instead of LDFLAGS to properly link against libpthread. Signed-off-by: Denys Dmytriyenko Signed-off-by: Fathi Boudra --- tools/testing/selftests/timers/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/tools/testing/selftests/timers/Makefile b/tools/testing/selftests/timers/Makefile index c02683cfb6c9..7656c7ce79d9 100644 --- a/tools/testing/selftests/timers/Makefile +++ b/tools/testing/selftests/timers/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS += -O3 -Wl,-no-as-needed -Wall -LDFLAGS += -lrt -lpthread -lm +LDLIBS += -lrt -lpthread -lm # these are all "safe" tests that don't modify # system time or require escalated privileges