Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1538502imm; Mon, 3 Sep 2018 03:08:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaIhi1ZI/EW+kC7+icKoFWVVolV9Re8ZEOFd12IckEIe33IOyMPIo02T+wZMclI3qoovuIn X-Received: by 2002:a17:902:8697:: with SMTP id g23-v6mr27744616plo.292.1535969305639; Mon, 03 Sep 2018 03:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535969305; cv=none; d=google.com; s=arc-20160816; b=t9HEui5dyjWSfsX7wNzLDznx5ptL7Sv38G/cAxGZJm8JYK9hInP5Yj11H/i0o0UYq7 y0gYioUPkiTDkTUjlJIxW4DxNRjQyt2iaLpgCXz6mpU+pf9vqrW614N/tbQ44fOPrajz XrHToLa5bapJkQ0j+yuyJ7bA5GnlQDTK1reVbUIJeClgmAZID2z+np373iEeoLH4a1dx OaSjaaRj8e0aCM83sxy84gf0CG16sU6NjpLoWnkxbzC2OwP57OJZiln1rZtgEmAwZbD6 w70v22+GowFX/VtTrKvg8zHQiph6wOM+WGNQT0JwXaalev0gJ9cc6JkpewjoaltOVW8o oUsA== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:dkim-filter:arc-authentication-results; bh=7i6iCxWxEbKlgnnaePKrj4e5/dvhMmvFvjan042Ific=; b=aVH2GrbVQG0UTM8nbkPQlkYEYDIXOL5q8tuG6TWiE+LqlkQl6HRix+KWfbNoMOS4gU VAN1jfh2J5M88nAiFFI2P1HvpHVRJvVeeYnNVrLxxkiUn4MkFq6J9HaYgKx0kxHPt/MT b70S9nDewI4Gy8hvp0jCiIxId+daCwBlnIh9rlAFLJx+mMQuSwVVxLCMEHQ5IrFuFK8m 9TpN2aYI7biWOKbwqajVlPf7skLSCJMx1vfXeoEimsRLXPMFefEAxBnfd/Y12HII7+nI oUhf7on9pFrSxgRnfqPIbZFd+qxmTpvg7hTdDJkXaOoKOhUxZ9IMa9fp9Fbu+QLWVpfp bduQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=KrpwfEqW; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b19-v6si19755764pfb.89.2018.09.03.03.08.10; Mon, 03 Sep 2018 03:08:25 -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=@nifty.com header.s=dec2015msa header.b=KrpwfEqW; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727561AbeICO0d (ORCPT + 99 others); Mon, 3 Sep 2018 10:26:33 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:17092 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727462AbeICO0c (ORCPT ); Mon, 3 Sep 2018 10:26:32 -0400 Received: from mail-ua1-f54.google.com (mail-ua1-f54.google.com [209.85.222.54]) (authenticated) by conssluserg-01.nifty.com with ESMTP id w83A6g5H004107; Mon, 3 Sep 2018 19:06:42 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com w83A6g5H004107 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1535969203; bh=7i6iCxWxEbKlgnnaePKrj4e5/dvhMmvFvjan042Ific=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=KrpwfEqWsnDgoOp9rMIIeS2cYu3ikbAO3JmpuV25fqmz9Bbwwv3jJEZKUtmHmzB3H 97ye3NJvOb4s8x4bG1sDnOrIBBpRsIFLlh/3g/OHyu8Qh58EqX46YC9DhEHgMuVgLQ 74cWDpKfV+Zoo2OBv5iNE0g7xUPwkN26ptG3g+JRm+DTmtdMenQ09GsKwc7Ce1+YFJ pQTDYKSZzwuUgfVfXiRKGcgDzxOn+F4sSzcemb7N1AUDxUZ3xYwqrDgjZ/WHiYFfa8 zS0fZaGTa2FOISesd8uSqWft0ScTfd9NYvMsD3iWCicrE2TBj3jEgdXwdBupRF/gDe SFqvPnO81zkEA== X-Nifty-SrcIP: [209.85.222.54] Received: by mail-ua1-f54.google.com with SMTP id g18-v6so20104uam.6; Mon, 03 Sep 2018 03:06:42 -0700 (PDT) X-Gm-Message-State: APzg51CAIxC++GCpmAIkaDWdtcc0KScFjZSZ+9pUH2YroWRkQTxpBeHe nkuBCM7RQOkRPOkg+ZEpgvaPq2+6d9tujQS7tl4= X-Received: by 2002:a67:7cc9:: with SMTP id x192-v6mr4825132vsc.9.1535969201306; Mon, 03 Sep 2018 03:06:41 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:7103:0:0:0:0:0 with HTTP; Mon, 3 Sep 2018 03:06:00 -0700 (PDT) In-Reply-To: <20180820233331.08dd2bfb@naga.suse.cz> References: <20180627143705.5a1fed1c@kitsune.suse.cz> <20180628111623.3807fe9b@naga.suse.cz> <20180806200725.4efa5d35@kitsune.suse.cz> <20180820233331.08dd2bfb@naga.suse.cz> From: Masahiro Yamada Date: Mon, 3 Sep 2018 19:06:00 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: due to kconfig changes kernel config file is no longer sufficient for configuring the kernel To: =?UTF-8?Q?Michal_Such=C3=A1nek?= Cc: Linux Kernel Mailing List , Takashi Iwai , Andreas Schwab , Michal Kubecek , Michal Marek , Jonathan Corbet , Yoshinori Sato , Rich Felker , "David S. Miller" , Jeff Dike , Richard Weinberger , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , X86 ML , Kees Cook , Philippe Ombredanne , Greg Kroah-Hartman , Ulf Magnusson , Jeff Mahoney , "Peter Zijlstra," , Mathieu Desnoyers , Frederic Weisbecker , Randy Dunlap , Dominik Brodowski , Nicholas Piggin , Linux Kbuild mailing list , "open list:DOCUMENTATION" , Linux-sh list , sparclinux , linux-um@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, 2018-08-21 6:33 GMT+09:00 Michal Such=C3=A1nek : > Hello, > > On Tue, 21 Aug 2018 03:15:12 +0900 > Masahiro Yamada wrote: > >> 2018-08-07 3:07 GMT+09:00 Michal Such=C3=A1nek : >> > On Mon, 30 Jul 2018 17:02:42 +0900 >> > Masahiro Yamada wrote: >> > >> >> 2018-06-28 18:16 GMT+09:00 Michal Such=C3=A1nek : >> >> > On Wed, 27 Jun 2018 23:07:21 +0900 >> >> > Masahiro Yamada wrote: >> >> > > >> >> >> >> >> >> >> >> >> >> >> >> out-of-tree modules are built with exactly the same >> >> >> configuration as used for the kernel. >> >> > >> >> > It is not true. And that is the problem. You need the config file >> >> > and dump of the environment passed to the make command at >> >> > configuration time to get the exact same configuration. The >> >> > environment is not saved anywhere, though. >> >> >> >> >> >> Why dump of the environment? >> >> >> >> >> >> If you are building external modules natively >> >> your distribution provides /lib/modules/$(uname -r)/build, >> >> which contains files enough for building external modules. >> >> >> >> You can pass the directory path to M=3D... parameter. That's it. >> > >> > No, that's not it. Since passing ARCH=3Di386 is the de-facto standard >> > to configure a 32bit kernel and the result of passing that was not >> > saved you need to pass it to make as well. >> >> >> If you pass ARCH=3D for the configuration phase, >> you need to pass the same ARCH=3D in the build phase. >> >> >> >> >> What I can suggest for you is: >> >> >> $ make ARCH=3Di386 defconfig >> $ make ARCH=3Di386 >> >> OR >> >> $ make i386_defconfig >> $ make > > Maybe you missed that but I do not want to build the defconfig. I want > to build a *particular* config which has been saved in a file > beforehand. >> >> > And you need to patch a number of >> > 3rd party build scripts that build a kernel module as part of a >> > bigger project. >> >> >> You do not need to patch a number of scripts. >> >> Just one liner fix. >> Add 'export ARCH=3Di386' in the top level script. > > And that does not work because there is no toplevel script. rpm has > three toplevel scripts - prep, build and install. OK, I understood real problem cases. I wrote patches to support non-interactive .config updates. For package building like rpm, deb, etc. the target ARCH is determined when creating a source package. If so, it would not hurt to hard-code to record ARCH in the spec file. > Building out-of-tree module is another toplevel script. As I said before, the .config is not reconfigured when building out-of-tree modules. Out-of-tree modules are built with the .config that has been used to build vmlinux regardless of whether you pass ARCH=3Di386, ARCH=3Dx86_64, or nothing. If rpmbuild is given target option like 'rpmbuild --target i386 ...", it think it makes sense to propagate it to ARCH=3D. > And it does not suffice to 'export ARCH=3Di386'. What if it was a 64bit > config? How do I tell? > > With more and more options left out of the config that depend on > compiler features, environment variables, phase of the moon or whatnot > you can't even tell what kind of kernel the user is running by looking > at the config. I added non-interactive .config update. Please try it. --=20 Best Regards Masahiro Yamada