Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1809989pxj; Sat, 5 Jun 2021 03:56:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXiXI/XMX/CgjZr5+28X/LCJsk4TAntKq/RS2fwS+Tg9vy/rMgOAoYyRBP2xj+7FSwlzj3 X-Received: by 2002:aa7:cc9a:: with SMTP id p26mr9658100edt.74.1622890563072; Sat, 05 Jun 2021 03:56:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622890563; cv=none; d=google.com; s=arc-20160816; b=ZhLbf2B/kFhwETGGeZXQ9LLug3yMsJm4N9S4lmI/tWW0R/bqeZIYPqD7nc9w1CFueR 3kpIQqLWwAvMGlOthgzXwB0m20b5/rP/ME2P1KeM/ZxH5Z3rMXYFNwFpmf2cMSk/DuCn +btNItouX3VBRg8Q92KC1OCewWS8iNJCK86rewlQKCaQhbpiyva5/Hfl9XR6Mrul4WPq hhFtd5AtPWqMpmj8Hzg4cGbNiXWePirMnt5/RODCOrhejlKjJxYraLdDxvyl7YPQ09DB CDhMAN3Um0vFCO0HtXUlUoKstWgpTTzcLxGf7mgUBk4RlvB/9jTIjPLdX4dABkP7Vm9/ NpPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:mime-version:references :in-reply-to:subject:cc:to:from:sender:dkim-signature; bh=AAjK4RnrixesQdsO5w2Wdh9utWEzsYLWg7tqEzuFSmY=; b=uL8MNNTniclxSaCoGiXibpsqtnTiuJLWu2iYUhnmiuYfLg75HBzQj1JPoId1xT0AIK AE5/4a6fC7qns6xqjZr8YSIZaKaHoM3FoP00M/etatydqUtrk1SWTkUhDCbr8cX36ZXR FbIprs7qXin/3bZxUAr1qf1+bhdsseyel/VyhbWie/dRIit7kY4ppuWMkJbLh7eUaTXR QTk8z3K+XIU3MI45hbf0wxFbzpBOmnZavPEfLNozZczu2hmz33Q60hp7Ayexrl/HBEE1 07YB+ITRYVlPQpNePNsnsGzX0rFzL0uTPR5GsdSY91cxekbPRb3zWD1Ai2vetRpNQ+02 7lMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vt-edu.20150623.gappssmtp.com header.s=20150623 header.b="N/Slh0Te"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=vt.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a22si8090209edb.304.2021.06.05.03.55.40; Sat, 05 Jun 2021 03:56:03 -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=@vt-edu.20150623.gappssmtp.com header.s=20150623 header.b="N/Slh0Te"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=vt.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230110AbhFEKxd (ORCPT + 99 others); Sat, 5 Jun 2021 06:53:33 -0400 Received: from mail-qt1-f175.google.com ([209.85.160.175]:34712 "EHLO mail-qt1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229892AbhFEKxd (ORCPT ); Sat, 5 Jun 2021 06:53:33 -0400 Received: by mail-qt1-f175.google.com with SMTP id u20so744177qtx.1 for ; Sat, 05 Jun 2021 03:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vt-edu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:in-reply-to:references:mime-version:date :message-id; bh=AAjK4RnrixesQdsO5w2Wdh9utWEzsYLWg7tqEzuFSmY=; b=N/Slh0TetcKjwO2WeBYGTZdg0GBXeo6pGPJZPy2nTmvBK96Ir8hF7Ydujt8g5woTtf 4pk4ZoCuWtZdEC06Q3J/V0UYF91j8mdLc1KELc2/DI0mMUDEzBT3v2z2VtbMs9NWDsTz wCj+4SWWZ3SSSo6hqGUcU2HgrQdY/kvuc7tUacf9uBesC3w0tVv53iPNW5sx05cohC82 FyBNQXVSXTqn9I1EKb89Sus1v2Q/asFhrNbKwgXAIh4IkqsuaReXXK9v5fpnDahYSzu5 OI64yZN045dOB/fFXfBea/mGklbYPRo7qy6WagAOrS9MoQa+fuxxx7TNazoih+Ji3a1c XcVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:date:message-id; bh=AAjK4RnrixesQdsO5w2Wdh9utWEzsYLWg7tqEzuFSmY=; b=tIjKdv5Tc0Vv2eB05lVRdAHDWdU1K3TCVu8nlQzfM8sSshKXUv6yWnVvsMMDvRTVuE vHpnLYri612H4m5B57UGUTvP1qdN5B9UKYukZXslVXdsJ6Cq803/w5+jndkOlxLNgZdo 9Zz8dn+jSpq1mv5Bl9aAe4H4WpZnExv4M7kGWa0MICuGlylNCQC1cwKo3MkQZtuK8b/+ AgLYQeQtTrUQ7m/c5i0343k1G5U/rjIwa3BytCJ8TLEIlTRwfLzqffcRfOb0KtXPGzog QpA7FNqXInGNtU/qaty9iAd6fwQyAQO0m3gDwypeLnTauBt9rz49qBPknZ8jWpl2sWDt O91Q== X-Gm-Message-State: AOAM533byHVHDATrDs2trnRgmiwMhDwwro4u0Hztb+TMkbGsWHV4w+K4 3lGfo8FdSVEZ2G8I469o9mzTVA== X-Received: by 2002:a05:622a:588:: with SMTP id c8mr8325520qtb.49.1622890245288; Sat, 05 Jun 2021 03:50:45 -0700 (PDT) Received: from turing-police ([2601:5c0:c380:d61::359]) by smtp.gmail.com with ESMTPSA id j197sm5599108qke.73.2021.06.05.03.50.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Jun 2021 03:50:44 -0700 (PDT) Sender: Valdis Kletnieks From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: Masahiro Yamada cc: Thomas Gleixner , Ingo Molnar , Linux Kernel Mailing List , X86 ML Subject: Re: x86 - weird cross-compile build problem with try-run next-20210602 In-reply-to: References: <454425.1622838810@turing-police> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 05 Jun 2021 06:50:43 -0400 Message-ID: <602426.1622890243@turing-police> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 05 Jun 2021 17:19:30 +0900, Masahiro Yamada said: > > Anybody have a clue why $(x32_ld_ok) is null rather than 'y' or 'n'? > > > What command did you run? > > I see this warning message for 'make install' for example. > > $ make install > arch/x86/Makefile:148: CONFIG_X86_X32 enabled but no binutils support > Please add one more debug line: > $(warning need-compiler is +$(need-compiler)+) > and what will you get? > Bingo. arch/x86/Makefile:143: need-compiler is ++ x32_ld_ok is ++ with CC=(.... same as before) And it was hitting on a 'make kernelrelease' 805b2e1d427aa (Masahiro Yamada 2021-02-28 15:10:28 +0900 275) # is an exception where build artifacts may be updated. This must be fixed. 805b2e1d427aa (Masahiro Yamada 2021-02-28 15:10:28 +0900 276) no-compiler-targets := $(no-dot-config-targets) install dtbs_install \ 805b2e1d427aa (Masahiro Yamada 2021-02-28 15:10:28 +0900 277) headers_install modules_install kernelrelease image_name 993bdde945478 (Masahiro Yamada 2021-02-28 15:10:25 +0900 278) no-sync-config-targets := $(no-dot-config-targets) %install kernelrelease \ I suspect it's this: # Include this also for config targets because some architectures need # cc-cross-prefix to determine CROSS_COMPILE. +ifdef need-compiler include $(srctree)/scripts/Makefile.compiler +endif and as a result, try-run isn't defined when we get into the ifdef CONFIG_X86_32 chunk in arch/x86/Makefile, which silently fails and returns a null. I added more debugging to double-check... ifdef CONFIG_X86_X32 x32_ld_ok := $(call try-run,\ /bin/echo -e '1: .quad 1b' | \ $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" - && \ $(OBJCOPY) -O elf32-x86-64 "$$TMP" "$$TMP.o" && \ $(LD) -m elf32_x86_64 "$$TMP.o" -o "$$TMP",y,n) $(warning need-compiler is +$(need-compiler)+ x32_ld_ok is +$(x32_ld_ok)+ with CC=$(CC) $(KBUILD_AFLAGS) OBJ=$(OBJCOPY) LD=$(LD) ) foo := $(call wombats-r-us ) $(warning foo is +$(foo)+ ) ifeq ($(x32_ld_ok),y) and that gets: /usr/src/linux-next/arch/x86/Makefile:143: need-compiler is ++ x32_ld_ok is ++ with CC=x86_64-unknown-linux-gnu-gcc -D__ASSEMBLY__ -fno-PIE -m64 OBJ=x86_64-unknown-linux-gnu-objcopy LD=x86_64-unknown-linux-gnu-ld /usr/src/linux-next/arch/x86/Makefile:145: foo is ++ /usr/src/linux-next/arch/x86/Makefile:151: CONFIG_X86_X32 enabled but no binutils support So the call to the undefined 'wombats-r-us' fails silently and returns a null.. and try-run is also failing silently the same way because it's not defined either. There's only a few uses of try-run outside Makefile.compiler, and it looks like x32_ld_ok is the only place where Makefile logic changes based on what try-run returns (the rest just change compiler flags). Havings said that, I'm not sure what the proper fix is. Move try-run out of Makefile.compiler?