Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp390691rdb; Thu, 1 Feb 2024 11:22:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEml6hSx+uc4HI1gR9zRl9hCgEsPpyb4GTu21QfI0LXYTu7GgbGcz1SvQFmf0SR/DtT68Bu X-Received: by 2002:a05:6a21:819c:b0:19e:2cfe:da89 with SMTP id pd28-20020a056a21819c00b0019e2cfeda89mr2637844pzb.43.1706815329501; Thu, 01 Feb 2024 11:22:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706815329; cv=pass; d=google.com; s=arc-20160816; b=PMuKN3xfpKTw+z5mWkH5OcBjy3JEVIcY44MGVV2H4gCkug++/sIKraJb+Ez1oWrYn4 9Bmy4axJo6ENBu/N0767c7Mmpv2ck+GwXUfxsvizG0FiZuSto69qi30D0vMWClH+U2E3 QYMLV8iAogv/nDs7TLY/y1FopPUEM4e9ijzfPQ4y+mD/Wdv1peLj4NT2GbxMG9COJCGe 2NYQfT+QlZ4EG3CvZF4x7KMkHW+C1S8jqLmTz2SnNELM8C1iD3hl8Iwq87fSLldmyYwQ L3iyB4M78USbvWL1rQ1nKsMGf8mUr1sMqUIQ2aXORlkTJVuYi+RCn2gH5FtUtT5edvsa ydlA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6EdBQXUFVVoGXhdwNhdWT8Lsh5IX5I5ht05nvw5zWQk=; fh=uw0bYHCgd//8ZsKNFKyyPybO3wm3Oi9e4NHtDBSFmWw=; b=aSEjABLwEjqmktmTkyP3dk+u+DczryOyTjxBWpY14eB5BbpT+ZMW7rmYSQceZofHLM Juzk6ARpfcqbeBothD0FSklceTkTaPQwzS2CpAqJDwTQQUwW4whSY7bKccO1T9GRaKd7 8rMNoh+bNKvtfjHrsgbDnH5g+CfiuF1u3eK6zCTfVHXI7h7xCYtlR6+zSisMI67uGc/6 /cOhayRILocIVfmx1qVajLHK84gIy6WiQv2rWApAr7kkMUMcy826I9AKmRWL1yM6XXGh IkI/5hzArFTTt/Zu/+twJLLa6xqrjbIOw/OOfki63VAX1sohPKEYo6+LcJroZF+UFt0o 247Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TwgaHeTy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-48758-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCVtrkT4wvVmNpf/RDlGvn9VhTbF5m13jwbOI0dMP2e59lovrHHovsUuaL0oLeO7PpDRg9Yt5uGvdkMnmEqFS8dDcI2otfaudhkbkfsmiA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v30-20020a63481e000000b005d6d3897a65si177945pga.830.2024.02.01.11.22.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:22:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48758-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TwgaHeTy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-48758-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 28F6728B4C6 for ; Thu, 1 Feb 2024 19:22:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F6C48527D; Thu, 1 Feb 2024 19:22:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TwgaHeTy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C599312FB11; Thu, 1 Feb 2024 19:22:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706815321; cv=none; b=Wy86/Mjv30JAs7IXWKg8XuKU4EsABB2lIueHlWAmYK1KbRQYFnJXrEsJCZGTVjm4qQLOWmjanePK2mxlvJ+RBKZMQK/2euf5kxm3SFANUdLZv81KjEuR0x18fNGHgsWzsiDlUb93yxnRpAl77LNwQrKfZDe70Itv9E3kXvl5mnE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706815321; c=relaxed/simple; bh=/GVp+KkWn8FbjPzBszbZ74s0vJwipfrVV+J3uWTKmO4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hwwpsPnr+nb3e7dxpbYOJFWUlcLqQi94X4IuzSE5WqJ4K+ye3gWjxxx3SEGQjrbW1Gkyan5tPdvMGRNj8bxuBv3o/sw3I3zThMsQaME+g+S4rYj9K4u6QmgKFho3SCVAywDnnEXGg5cpPlzIB4iCGR0BsTbABlyApjorP3S+Nus= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TwgaHeTy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16A0DC433C7; Thu, 1 Feb 2024 19:22:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706815321; bh=/GVp+KkWn8FbjPzBszbZ74s0vJwipfrVV+J3uWTKmO4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TwgaHeTyLUp69ZlVFY3x7ngz1RK5hWTi7OZQ6FYlfXtaHqU9TCc58hNAv5Ch2StAa SuYlanJMLgGmBvBsCYdQlgWJeeK4HPQBPS/TtQ5/NVUI60Em5ozQJadYRYKo2AJYzo kDq8ASD/6BJm8m+rwPU6B43lPV7VA1ulkPu+sHxVvvYi7b7KTbyoUMmLG5SoUrfU+K cIAihcKLxKasiI7p6PyowNUSnoGNQa8Tp/SF2m67saGfMei/nubiyilawnz5RBMdbC b7cq/Mqm43Z7YIaDLuU3/VLRju4mjnNO7Vbe0w9WphkkAqGEByer3wTLS5yfIMXTCF 4egtnuTz1pGTA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id ECED740441; Thu, 1 Feb 2024 16:21:58 -0300 (-03) Date: Thu, 1 Feb 2024 16:21:58 -0300 From: Arnaldo Carvalho de Melo To: James Clark Cc: Anders Roxell , linux-perf-users@vger.kernel.org, Linux Kernel Mailing List , Arnd Bergmann , Mark Brown Subject: Re: Perf not able to cross compile Message-ID: References: <511f5874-3c97-5928-fd59-b49516ca6b2a@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <511f5874-3c97-5928-fd59-b49516ca6b2a@arm.com> X-Url: http://acmel.wordpress.com Em Thu, Feb 01, 2024 at 11:52:07AM +0000, James Clark escreveu: > > > On 01/02/2024 11:32, Anders Roxell wrote: > > Hey, > > > > I'm trying to cross compile perf ARCH=arm64 on my x86_64 host from > > linus tree [1], branch master. > > > > > > This is the failue I see, full log [2]: > > > > ... > > CC /home/tuxbuild/.cache/tuxmake/builds/1/build/libbpf/staticobjs/elf.o > > CC /home/tuxbuild/.cache/tuxmake/builds/1/build/libbpf/staticobjs/features.o > > cc1: error: ‘-fcf-protection=full’ is not supported for this target > > error: command '/usr/local/bin/sccache' failed with exit code 1 > > cp: cannot stat > > '/home/tuxbuild/.cache/tuxmake/builds/1/build/python_ext_build/lib/perf*.so': > > No such file or directory > > make[2]: *** [Makefile.perf:678: > > /home/tuxbuild/.cache/tuxmake/builds/1/build/python/perf.cpython-311-x86_64-linux-gnu.so] > > Error 1 > > make[2]: *** Waiting for unfinished jobs.... > > LD /home/tuxbuild/.cache/tuxmake/builds/1/build/libbpf/staticobjs/libbpf-in.o > > LINK /home/tuxbuild/.cache/tuxmake/builds/1/build/libbpf/libbpf.a > > make[1]: *** [Makefile.perf:261: sub-make] Error 2 > > make: *** [Makefile:70: all] Error 2 > > > > Running 'x86_64-linux-gnu-python3-config --cflags' I see > > '-fcf-protection' in the output and this happens when I'm building > > cross compile arm64 on my x86_64 host machine. Building on an arm64 > > host works. cross compile x86_64 on my x86_64 host works too. > > > > I have 'aarch64-linux-gnu-python3-config' installed but that isn't used. > > > > $ x86_64-linux-gnu-python3-config --cflags > > -I/usr/include/python3.11 -I/usr/include/python3.11 -Wsign-compare -g > > -fstack-protector-strong -fstack-clash-protection -Wformat > > -Werror=format-security -fcf-protection -DNDEBUG -g -fwrapv -O2 -Wall > > $ aarch64-linux-gnu-python3-config --cflags > > -I/usr/include/python3.11 -I/usr/include/python3.11 -Wsign-compare -g > > -fstack-protector-strong -fstack-clash-protection -Wformat > > -Werror=format-security -mbranch-protection=standard -DNDEBUG -g > > -fwrapv -O2 -Wall > > > > I tried to set PYTHON and PYTHON_CONFIG too, but didn't work. > > > > It doesn't try to use $(CROSS_COMPILE)python3-config, any idea how to > > use the correct config? > > > > Cheers, > > Anders > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > > [2] https://storage.tuxsuite.com/public/linaro/lkft/builds/2bc6x6cISHzG9Jgo0oAVv2OgLOG/build.log > > > Hi Anders, > > I see something similar but in the end it works. Despite the name, I > also get perf.cpython-311-x86_64-linux-gnu.so generated in my build, but > it's actually an arm binary. > > For me I'm using python3.10, and the x86 config options don't include > -fcf-protection which is probably why it can compile successfully with > the arm compiler. > > It looks like your assumption is correct and it's not using > $(CROSS_COMPILE)python3-config but just python3-config. The answer to > how to fix it is probably to start hacking at the makefiles, if PYTHON > and PYTHON_CONFIG don't work either. Right, that seems like a good direction in trying to fix this. - Arnaldo