From patchwork Wed Jun 28 17:08:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fathi Boudra X-Patchwork-Id: 106554 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp158230qge; Wed, 28 Jun 2017 10:09:29 -0700 (PDT) X-Received: by 10.98.78.88 with SMTP id c85mr12021058pfb.17.1498669769193; Wed, 28 Jun 2017 10:09:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498669769; cv=none; d=google.com; s=arc-20160816; b=YdBSooyzxCN5DAmEIjkXldKI23HIo78m6EhpuIbZXOGj4vh9gGQfiTsuh9RXHh5hTI 4LiKGJrVNAlkNGqls1mgpCh7Y6PTnfHVUgHjPfk5Um3rrhODXfydZ0OhqTCsRlYEwmLp wyUWFOOyVNnGDDtb3uemZnkw2XV8V2RDIn4AeDcq4U4bfRMfF3ZQpEB0TEzQkDIIGmUH ZGTTEo7VfgJK+2Em/41CjswcVOrwsvTr9z7U9VMtLGYyxG0HQoPLN+N/2E/50RAU3C+N gh6PtVZYEkR2PGYslkAsBf9Re1y5qn0bE4NPDY7Z/bCmpq0JeQ//ibVHVLqGCOIz6sG3 f9KQ== 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 :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=a67OlfvCSyEjyfSaF+YANYzBi//CKzXLPcwlB7NIV6A=; b=yH6yoTzlFc5xlXD84BE3cpCckYY62P9PwYBY+Fe7ZPoMfDvXiU8F5XGTq0IJku6T/P dFzxIZhYuFlWz3yYsXZ667CcN4RkBtI68rwuuEtCERqClYXM6vXdYrjoJ5ADcpsNjocD YaDyo04GKIklt2TaimT3fQTWEYzLR2oBr8n8WIKLU7/QQP/F/xTAATP9bp66eyj6V6dq wBLGii49TXLlKGxFQ3E12EGa8q4QQDv4HC3/5GSZzfa+UJ0s4/cbGvFQQqsMujK8mIgB 9vo3V8TWJBFNqJeX8bUvwhU16SJ/O4gmaaDNwHOWEq0dnJOXD+IqI+OacJJt8HODtw2j V5yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=SMRZPZQY; 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 c125si1912763pfg.322.2017.06.28.10.09.28; Wed, 28 Jun 2017 10:09:29 -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=@linaro.org header.b=SMRZPZQY; 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 S1751898AbdF1RJK (ORCPT + 25 others); Wed, 28 Jun 2017 13:09:10 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:34819 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751511AbdF1RJE (ORCPT ); Wed, 28 Jun 2017 13:09:04 -0400 Received: by mail-lf0-f43.google.com with SMTP id b207so38764271lfg.2 for ; Wed, 28 Jun 2017 10:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=a67OlfvCSyEjyfSaF+YANYzBi//CKzXLPcwlB7NIV6A=; b=SMRZPZQYll2e0xa3IDk14+a1OGuuzIz0sxIgTxIE04v2qm3OTVMI91qDeBMxj8z0XZ qLt+WAe5IlJvbL8rXpw0uZn0Y5+c6FDq7Ea4+OjXTe3vrIVzX+gULdfKanDOR4lhfYQ3 rb6xaQqicle+0Jp+eH+eYYT4QD5tus8wYkgRk= 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:mime-version :content-transfer-encoding; bh=a67OlfvCSyEjyfSaF+YANYzBi//CKzXLPcwlB7NIV6A=; b=GCHgBBKeCod57bH8If6ffRhSKKHpSsqkwGkj/0kkTHwi8o10orHJqRSD6UdPht/PJt KsNl2zlE9KC6DWgrW0oaHw3z4+eWF1MOqZQhNhuqJWpii2wdHwxT8WEk42SuFp/vnLv8 qMP6tCEvc6fBspqI2VeptuU1mv/QvvsVThWi5XW9PJnjYFXhfm/5ao8TqB4d9vgh29M1 4ihsDJGLSEvI/8GfRR61fMQcWUriLE4FcuohdeuVsj7gbeWMSJY4ze1+JNNEVSBLcW8C iQvKB7eZRWnqYwlQT0nvXMT5c3SEYHSF58FUWZAyekpQhbhuif1RW3LJ6iUFqgsHCp6i Mp0A== X-Gm-Message-State: AKS2vOzmh25WDaS8faC9EZFNADFFHtAwK8ZQFQ8D0FEl8l+w1NqleJYS SZTpws7CP150uN8o X-Received: by 10.25.15.74 with SMTP id e71mr3999771lfi.7.1498669742277; Wed, 28 Jun 2017 10:09:02 -0700 (PDT) Received: from localhost.localdomain (a91-156-68-101.elisa-laajakaista.fi. [91.156.68.101]) by smtp.gmail.com with ESMTPSA id h6sm580796lji.59.2017.06.28.10.09.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Jun 2017 10:09:01 -0700 (PDT) From: Fathi Boudra To: linux-kselftest@vger.kernel.org, Shuah Khan Cc: linux-kernel@vger.kernel.org, John Stultz , Denys Dmytriyenko , SeongJae Park , Fathi Boudra Subject: [PATCH 0/3] selftests: fixes for undefined reference (LDFLAGS -> LDLIBS) Date: Wed, 28 Jun 2017 20:08:56 +0300 Message-Id: <20170628170859.28583-1-fathi.boudra@linaro.org> X-Mailer: git-send-email 2.13.0 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This serie fixes undefined reference errors caused by the usage of LDFLAGS instead of LDLIBS. The issue is 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. Fathi Boudra (3): selftests: net: use LDLIBS instead of LDFLAGS selftests: seccomp: use LDLIBS instead of LDFLAGS selftests: timers: use LDLIBS instead of LDFLAGS tools/testing/selftests/net/Makefile | 2 +- tools/testing/selftests/seccomp/Makefile | 4 ++-- tools/testing/selftests/timers/Makefile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) -- 2.13.0