From patchwork Wed Oct 2 23:14:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 11171895 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 A508F139A for ; Wed, 2 Oct 2019 23:14:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8395721A4C for ; Wed, 2 Oct 2019 23:14:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570058074; bh=OZVJeZ22vcNjw/uCU9WIlcSTnKiZymJMTEEQaMbl7TE=; h=From:To:Cc:Subject:Date:List-ID:From; b=kT1mmyZ+0dM3+klNZdSc3B+Sa/G4XGMwOK1wbpNQbDx9J1nr81Jg3Gy8nObFpdgCz T6lS9ljH3emoIyfgcDpOrwPkb+obx7oqW03XWaYMj18eIY0bEAv7QeEO4fyY+OYzhw /e3m76fFaIGe88feSEO/sUB+K5tg7mbTkx+rvc0Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727281AbfJBXOe (ORCPT ); Wed, 2 Oct 2019 19:14:34 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:34271 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726708AbfJBXOd (ORCPT ); Wed, 2 Oct 2019 19:14:33 -0400 Received: by mail-io1-f65.google.com with SMTP id q1so1306275ion.1 for ; Wed, 02 Oct 2019 16:14:33 -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=xvZas5u4F0ANJvTgj3n1e3Kg28XWglgthvIgi7KiUDM=; b=OAmzgMLRqJrsm01/oVo0z52yps2KIsjjA0iSxmFhaj0J88TZvinG5qtiC7/sCqrJct XrgfqrnXnUfbVHpnU/DQZtmNicYVO9mW/frxnGp5y9Aqp4/NAigNRU873DNLZ4Zvu29D LUI0gg2+7ZwzBWUdbPnc7BM6q8a4zpw/xTOws= 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=xvZas5u4F0ANJvTgj3n1e3Kg28XWglgthvIgi7KiUDM=; b=ET6RSnLOoajBfEfjthq/HrxySa7HIPtJUmmIR5Y7HvA7oMME1wcSuqKym/Ue+YwS5Q HFEMx2LYv7+LLQQAlhgznFDs7rznUPTZLZ1e5oK2zGFsYG/C5q1kxBP2gfIIWm0BAJ8i ufFKUawLTH6WsuvIeLFClExGWksDNsLgahOMS6Bgj+IGcxvSbMDFml9o3GnFBRVZy9C+ VMmqFLsVwAjWHi7ENvPIo6Wcx8BUYcY++yI8JZidxR/zp/3itLfWzqlH/CQyC0K2pckr r6fEJDl3KwiHUsR2+lm4iCxyHkzZo5wjEhvBYchUl434G4XeAwM1mBm8oaZaRkTm+9RK djTg== X-Gm-Message-State: APjAAAULUDAtQZFnl0r/l7S6QFDBJeaKlO9qLKelc/v8FRIUoI0Li2TI I2RuBqr6uWPOtqhdLkr+pzLFig== X-Google-Smtp-Source: APXvYqzuqtspnkYcsNldhwxDFk74uox7GnxjgX02w15feBtduAjf6+BWwfmMwuq7uIhWVVekiK+5hw== X-Received: by 2002:a92:b752:: with SMTP id c18mr7008975ilm.42.1570058072984; Wed, 02 Oct 2019 16:14:32 -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 m5sm259542ioh.69.2019.10.02.16.14.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 16:14:32 -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 v3] selftests: kvm: Fix libkvm build error Date: Wed, 2 Oct 2019 17:14:30 -0600 Message-Id: <20191002231430.5839-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 necessary, which is the case 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, both build variations work. "make TARGETS=kvm kselftest" "make -C tools/testing/selftests/kvm" Signed-off-by: Shuah Khan --- Changes since v2: -- Removed extra blank line added by accident. -- Fixed commit log. tools/testing/selftests/kvm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index 62c591f87dab..7ee097658ef0 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -48,7 +48,7 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ -I$(LINUX_HDR_PATH) -Iinclude -I$(