Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1954166ybh; Tue, 14 Jul 2020 11:32:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3TbY1IgMCPGpG/YAX8gbElnUxjlM5uLQeYzrM7F5WA782qSVWs9VVuku7EpL1iV8VSni+ X-Received: by 2002:a17:906:ae56:: with SMTP id lf22mr5659373ejb.59.1594751529659; Tue, 14 Jul 2020 11:32:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594751529; cv=none; d=google.com; s=arc-20160816; b=Wqb7pwX52jFE/rISqn6mTs/9UUAZlrod+T8SqiERpWCmjrqhFtuA4kdjv5l7kp84kE irOkdIaKwjiGSl7NFwqB6ZzjsxceHBrki1y6TPrLprXKcL0S9ZVC6J/VQDQdBekyZ/3E FdcKAL8w9kzglXw6QJ/zylbj7YPn/VKD2c7xDRgaN6EZyM0qS15SPtLZ4zyKN/09wGLj 7aOvw/6uS+uXunYDBCFc/Y8NGx5xlr2m99oZek5JrysgfHAEfwm6/3kp7rJ5uivVcvhK S7YBneucCx6yjYeb915ypEeYseRSp002z5vHrPA3BGMgLAqFOO4ix/KwpAJNPtGslU3Q AzIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=dWHcSl+qV/ewcMbxZBTT0+5lIFUMoe4sskE51jeT9lk=; b=MeOz3jMjjU4oFuYOXDrbKpxl4RWCRTcTd9H+jFGmLLAfCDGqJCl8YEPTuIGieS1zjE wM9mrwv7Di1PDBwAA19V6BbWdIRPZp9pgAlmBdd2KAj09sl5iGtS5ubnWDN0MMVgn5Az amggmtIGB7h3Ktyt0FzKNYxumJJ6BGxyxS6kfrEqxqJ7g0eaZwOb0kAr0BpwQ8iZvnD9 50bwklAwNAJOeMhbtAEUSJCWWGhlj0PH/VlYlf3m5WNVxN3ZJAfAdL7GkRzKW9Gkh/Jv N5RUD/Sj3rEb8QXyD9rdYbbEeeTgUkRYT+sH+evWEGJB818skmD1Vec5ENP3qLYM2uNh IYzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hRtCYfvr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k19si11883577ejk.27.2020.07.14.11.31.46; Tue, 14 Jul 2020 11:32:09 -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=pass header.i=@gmail.com header.s=20161025 header.b=hRtCYfvr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729280AbgGNSac (ORCPT + 99 others); Tue, 14 Jul 2020 14:30:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729257AbgGNSa0 (ORCPT ); Tue, 14 Jul 2020 14:30:26 -0400 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F464C08C5C1 for ; Tue, 14 Jul 2020 11:30:26 -0700 (PDT) Received: by mail-il1-x143.google.com with SMTP id s21so15044978ilk.5 for ; Tue, 14 Jul 2020 11:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=dWHcSl+qV/ewcMbxZBTT0+5lIFUMoe4sskE51jeT9lk=; b=hRtCYfvrOgpiPBp2kK7bu3rXM3+A1WNg1/pBdBE/siaWiM/19t27VY9kkFGjEq+SJK ZYvOB00ShqmSXS7CXhPY8hZ9MCMnJS6Le3tuc7ckIa1uqYQINYDueKcnthpHeIae4vI6 yepNLFfcmEzLvmlLX6QA6wM3yFaUX3DigXae81DLwVuCO9cyo/Mf+lTXGlauuloY8L9r yuTDSstfIPBPncoGehCS60mw7HFl16ZNvxyQU8IqVnkQoWDFP83Vdmtv87kqcuxMgo2r NqW8K3Grv6DvAv5jpkr/t6gv3c4PEIR1qWa+33t1KsIcLY5+o6NwaWxxJxiSSk8tj6Mj 3pXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=dWHcSl+qV/ewcMbxZBTT0+5lIFUMoe4sskE51jeT9lk=; b=oB+PathOP1svVHHeXJE+cY2WHJobUg1rvb/mKEqkdc32mcfkpy8TdDkUfHeb+/if+n 2iISsKEay/jFl/ZJYwcSTjwTRWRsVuJ9w9ocfTmv6JQTcMvUHzbH3U3WzByqJwWJEb1u jRhQkWcgimqVV9tgeD2TBO2FT+Zp85nxU8NnbiSjumysB9i9swl1jylQ6qL3p/z3NnUg x6YmmDxPHChECuvRsaivQb/BzSqYCuPVB5qvNfVIhoOHUL31oCg8wuD3Fp/VxBsE5n24 9XLmiIC0r1n40eEipASTl/8JB2YoHgREXvB1PYZHLXSXNXQmnz8BTHq0Hbcu3vfsP/vv fMRw== X-Gm-Message-State: AOAM533F0YxSrjA9JUtDukuKP6hzN46aMm6nj1EzaDXOTctCAIfeqkhg pSmGmsNZ30siL9iR7w8vbmfwegncpi1amxiBsAQ= X-Received: by 2002:a92:d843:: with SMTP id h3mr6290036ilq.255.1594751425849; Tue, 14 Jul 2020 11:30:25 -0700 (PDT) MIME-Version: 1.0 References: <20200629140928.858507-1-nivedita@alum.mit.edu> <20200714023836.2310569-1-nivedita@alum.mit.edu> <20200714141550.GA329060@rani.riverdale.lan> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Tue, 14 Jul 2020 20:30:14 +0200 Message-ID: Subject: Re: [PATCH v4 0/7] x86/boot: Remove runtime relocations from compressed kernel To: Arvind Sankar Cc: 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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 -