Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1993741ybh; Tue, 14 Jul 2020 12:34:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwRxk1GRcx8if30+FSsRAp60Lkx5r9JF2KpN6v1IF3d+nbWh4KVg+urmUeLCd/fH6Vyfqx X-Received: by 2002:a05:6402:1841:: with SMTP id v1mr6134165edy.198.1594755255692; Tue, 14 Jul 2020 12:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594755255; cv=none; d=google.com; s=arc-20160816; b=CZ82gH9XfoAPg4IdPqSrUyX/8ElTARfzR9pBedLz/Xb77KVtf3l75uNlJEWl+1MzPZ SalArXhWR9e7Z8b7oohnDFYzWFYpdGbeogYcc4dr6ZbXGoqM+ZMsSx6dnrkQwuaV3XYl DC2RO18XrbniJVk7LUJDm8RIzcMY1Agci3kM4qVC03R4UuIQEPS6ZjbeT1ePiDidsPv9 LeJIunlQA/ZUBRjSvK0hR74mRgCdyWvuQUizzK6JJbLn4d/RL+paIMPx+qyieft4sTT/ YGb15LgXGraCTasGRRqDwPOeq6oycXpI2Tad/RrtDl7tplU87Ry7pG/uNOI32tAjUBR5 rYlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=BGNvPJrHn1Rri9TOnWUH5zEtUJcHDoODobxdHdGDsPM=; b=EWBP0uK5hoh12bIqymjYJhM5sTrlHmyM3oCQi5oOLGpM3fblYKQQwQq4uVUDOYmePb sm7OWlXfAZcLZO+2tOlDOOfXs/PyuN7TNlbgPsPincPRi0ptExRLVZeEycJi2Fy37Uih Zh0TMS6pastPx+jgQbmFRzjnFIrdcnxOaEjJB+4GgL/qZzB1H4ZHUVLmW7kZfNqGPs+i N5N2N8+i3a7LEFpjhHgUeSL/GMuGezi8uWyd2Hu373NRQ7CtoXPayG0TIX7tKUJhzbtJ GNVBipfWkHgcqlgAiuhpOOCf1F3JmQ8JT3RLyVwUJ+AwRmaXwOO0A4e19DTlO1PCcQKn xSlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=BCZcMlRn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e24si11793353edv.342.2020.07.14.12.33.45; Tue, 14 Jul 2020 12:34:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=BCZcMlRn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729517AbgGNTaA (ORCPT + 99 others); Tue, 14 Jul 2020 15:30:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726169AbgGNT37 (ORCPT ); Tue, 14 Jul 2020 15:29:59 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CC18C061755 for ; Tue, 14 Jul 2020 12:29:59 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id e12so13757103qtr.9 for ; Tue, 14 Jul 2020 12:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=BGNvPJrHn1Rri9TOnWUH5zEtUJcHDoODobxdHdGDsPM=; b=BCZcMlRntxTI5jblvCeUvd216n7w0E/8W6IjcbntL9UzLJJ/xqnuM1unpNE2TBje+e sUDmXjigeM+iQp4cejYES+dBr3D2LDL+udZH4scnvBcw01Oz261qVqDews1Hmr2URi0U tmFNb37rO2UsDFWGo6OAuejqHKsSA89vYzceszlDyHXlBJVxk+DsEZ/cS3ItoHHnWKKM NpiLTKrISMTnqixB9X4I+2XAX0HWXUVTKC0DhhqU430TYEobYb6RCkhnHkXY6fAAKwSz b6K116zy756G8EZSNuD5iH0p1z9/ktcGdaEurmHR8OZD+OlJ3D/0YQemmbSX78zvRiET hwrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=BGNvPJrHn1Rri9TOnWUH5zEtUJcHDoODobxdHdGDsPM=; b=lXk4z7zakRRW0/XRpU6806k+sG+mSMj2BDm97tb2gfEdXwxGCv/OEXJPPXOIozno/R T7v5GEK1/HmoNUxKOjEc2yD7VXSRxtKirQQzBVNeQ6wjrl/MFMSrnovDtgoXt34Qvl0C DqQ9nDoEdQBRUQSRDuenU8E3iqZRkxqU8ywZS6PGIUjoEUqgNaNs5VBTDtpX4dvn5Cij L0P3mpzAJgaAfGTmrlI6PVDRCSzxjgZ52zNUrbZYXNy68e7hSK/62c+woCov5op/2hdh LOJNXlvDMCoeVyOMb/E1ybyCb22IurNtY5HIieCbI47FiEt23iWcT6ph7l/exoZOB52S 56fA== X-Gm-Message-State: AOAM532msaCYuVO2Y1qLle0nQN8J/ksfgxXHDUPLGWAiCJtbw3XVS4Hs BXDmEVpeBVPrCkHYH/U8C0U= X-Received: by 2002:ac8:178b:: with SMTP id o11mr6187972qtj.320.1594754998616; Tue, 14 Jul 2020 12:29:58 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id c9sm22591590qko.24.2020.07.14.12.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 12:29:58 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 14 Jul 2020 15:29:56 -0400 To: Sedat Dilek Cc: Arvind Sankar , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Nick Desaulniers , Fangrui Song , Dmitry Golovin , Clang-Built-Linux ML , Ard Biesheuvel , Masahiro Yamada , Daniel Kiper , Kees Cook , Nathan Chancellor , Arnd Bergmann , "H . J . Lu" , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 0/7] x86/boot: Remove runtime relocations from compressed kernel Message-ID: <20200714192956.GA689174@rani.riverdale.lan> References: <20200629140928.858507-1-nivedita@alum.mit.edu> <20200714023836.2310569-1-nivedita@alum.mit.edu> <20200714141550.GA329060@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 14, 2020 at 08:30:14PM +0200, Sedat Dilek wrote: > > I did a full new build... > > > > ...and it fails with ld.lld-11 as linker: > > > > ld.lld-11 -m elf_x86_64 -pie --no-dynamic-linker -r -o > > arch/x86/boot/compressed/.tmp_misc.o arch/x86/boot/compressed/misc.o > > -T arch/x86/boot/compressed/.tmp_misc.ver; mv -f > > arch/x86/boot/compressed/.tmp_misc.o arch/x86/boot/compressed/misc.o; > > rm -f arch/x86/boot/compressed/.tmp_misc.ver; fi > > *** ld.lld-11: error: -r and -pie may not be used together *** > > make[5]: *** [scripts/Makefile.build:281: > > arch/x86/boot/compressed/misc.o] Error 1 > > > > It's annoying to fail on the last minutes of a build. > > Sorry for being very honest. > > > > I applied this diff... > > $ git diff arch/x86/boot/compressed/Makefile > diff --git a/arch/x86/boot/compressed/Makefile > b/arch/x86/boot/compressed/Makefile > index 789d5d14d8b0..9ba52a656838 100644 > --- a/arch/x86/boot/compressed/Makefile > +++ b/arch/x86/boot/compressed/Makefile > @@ -51,7 +51,10 @@ UBSAN_SANITIZE :=n > KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE) > # Compressed kernel should be built as PIE since it may be loaded at any > # address by the bootloader. > +# LLD linker does not allow -r and -pie options to be used together. > +ifndef CONFIG_LD_IS_LLD > KBUILD_LDFLAGS += -pie $(call ld-option, --no-dynamic-linker) > +endif > LDFLAGS_vmlinux := -T > > hostprogs := mkpiggy > > ...and was able to build, assemble, link arch/x86/boot/compressed/*. > > - Sedat - Thanks for the test. Can you share your .config? The error messages look like they're coming from running modversions on misc.o, which is unexpected as it shouldn't have any exported symbols, and it doesn't in my builds. In any case, I think the right fix here would be to add -pie and --no-dynamic-linker to LDFLAGS_vmlinux instead of KBUILD_LDFLAGS.