From patchwork Wed Oct 2 23:03:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 11171891 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0455113BD for ; Wed, 2 Oct 2019 23:03:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D77CF21D82 for ; Wed, 2 Oct 2019 23:03:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570057430; bh=rGgf3M8E8cdrPPfviqTZz+CC5G0oBSB873QG+Zz57Gk=; h=From:To:Cc:Subject:Date:List-ID:From; b=pXwDNnaPUQGkmBdGYs4pvzLC0jvYRsF1po7JwJ7yE4JnIENbmEut22Ao38uP3XwYH zXdODJEhlVNFc45Dp6NvhrP156MaJsiLL3ohdX0ZX2S0AZFPDCjJXiaD//HsDEbodK OsGTPgvl2D4vPXBwJAk4LlfzW1Pe/zvxzl+cmeo4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728140AbfJBXDr (ORCPT ); Wed, 2 Oct 2019 19:03:47 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:38299 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727976AbfJBXDq (ORCPT ); Wed, 2 Oct 2019 19:03:46 -0400 Received: by mail-io1-f66.google.com with SMTP id u8so1200030iom.5 for ; Wed, 02 Oct 2019 16:03:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oV/9b2AKj59V2uwPpS7RJHBFX/8QSHfj0AU6FMbpQCA=; b=dK+p1sIqIAJ8RGyefAphtb6lEwlpOLd/UkICw4usv/JjWR6t1kHw7a+p1pq3Qsqkj9 URSJmGJkWDsHaeuLD2TGa7MWq+2juzA/OirywcxzN3IXLaSzy7LVKAXYH0Q+B54Ejfr4 6PWic2A87QP2n0FYWCnFub7PPs/KIdmW0Lp+A= 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=oV/9b2AKj59V2uwPpS7RJHBFX/8QSHfj0AU6FMbpQCA=; b=P8xPUELAtfsfXNeFH5sISf5laOuP6qhvlppf4Oyw7slVXAMJJrobD/BJwNBXRUcMGl eGkldRL9IJZUpn7C/kQMiRJ1rTxtIDYpBsuByncKbcMk3zGu3GpoUI6tbstGd4MSXMkg ylSW2xe5BZPCxWDK8RXYVFUAjMguEa8DTpv1tndfST7KkJ0r0iZzei1UpmFY6fhqtZrC jLkzrI6ySTh3tHSlNhcDkxQE5nauhGbYMW54rhcrOwXHMAxdMPZsq7XlEbVuL8/vytgF /fPKhDNQHpYVlM05DOcAi47VOrKL/RmH45/UOKeDLM1OXRbLl2+rv6V7G/JGYl+8Kxzk BjHw== X-Gm-Message-State: APjAAAVNx10ccANcx4o+Dc7d17XrmyxHslcAyTP2VdVgE6uGQPJ3/DHQ e2BE4XcdGbN20meZn8pebSoj0A== X-Google-Smtp-Source: APXvYqygZWjkzv74/ZqaLQIipRxpUSbpqKXqXE5cRKwBIa0D4JgiRCE/Hg8dKE+sssxzkBGZVNthGA== X-Received: by 2002:a92:b74f:: with SMTP id c15mr6837193ilm.43.1570057425858; Wed, 02 Oct 2019 16:03:45 -0700 (PDT) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id 128sm212298iox.35.2019.10.02.16.03.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 16:03:45 -0700 (PDT) From: Shuah Khan To: pbonzini@redhat.com, rkrcmar@redhat.com, shuah@kernel.org Cc: Shuah Khan , kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] selftests: kvm: Fix libkvm build error Date: Wed, 2 Oct 2019 17:03:43 -0600 Message-Id: <20191002230343.5243-1-skhan@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Fix the following build error from "make TARGETS=kvm kselftest": libkvm.a(assert.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC This error is seen when build is done from the main Makefile using kselftest target. In this case KBUILD_CPPFLAGS and CC_OPTION_CFLAGS are defined. When build is invoked using: "make -C tools/testing/selftests/kvm" KBUILD_CPPFLAGS and CC_OPTION_CFLAGS aren't defined. There is no need to pass in KBUILD_CPPFLAGS and CC_OPTION_CFLAGS for the check to determine if --no-pie is necessary1s, which is the when these two aren't defined when "make -C tools/testing/selftests/kvm" runs. Fix it by simplifying the no-pie-option logic. With this change, bith build variations work. "make TARGETS=kvm kselftest" "make -C tools/testing/selftests/kvm" Signed-off-by: Shuah Khan --- tools/testing/selftests/kvm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index 62c591f87dab..02d20aab9440 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -48,8 +48,9 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ -I$(LINUX_HDR_PATH) -Iinclude -I$(