From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by sourceware.org (Postfix) with ESMTPS id 8E0DC398E409; Thu, 6 Jun 2024 02:41:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8E0DC398E409 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8E0DC398E409 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.210.54 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717641680; cv=none; b=KOXgdXlfMGqH3OjayykBiEtS7tuGfPn+7z+Qa3AAW/QdzTxGpUIKj0ElMg22UTyaryiFWBw9WNjHaZAIZHie/wPEdt1kR2+pomIsXXn/Q44JI+HLCNxmSCw3+WI/BlrdWx3wjTFd5hNnWWnldEdUDBO+UgaCTCzaZu152TkpBIo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717641680; c=relaxed/simple; bh=hvt2w2+sZSLTmzYnHBVmT338XOlLAfLYesbG9imEY4M=; h=MIME-Version:From:Date:Message-ID:Subject:To; b=a0mcyhnqk5h9/tjZoMkMLRXBNsGcgC/+cwKbjJ5Sj9OJOxFUkqR+oJaA1Xh/yNHIk2QQI7/jBW9FSlW1gIGhe2BGjo2onttVevLIXuu/oHF4j3ZRR1x8/vsaP3yt3Dwz1R7wtJXnzEL+fRqH6gqWUU9bwtLUpkEbfld+48n6Xh8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ot1-f54.google.com with SMTP id 46e09a7af769-6f9502c5145so24539a34.2; Wed, 05 Jun 2024 19:41:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717641677; x=1718246477; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IQ2a9UYmnUSgsBl/9aEzfyeUY40yCVKHufCjtVRETR4=; b=w5j8OONvWgTKk1q8gQjvxkEnDBUfWTPYmd3FfbPkYDkVj80A7x6Yfchv5SC/0B6ccV P9dYmybb163kUgMX1I60nlfbPdg5S3eCXf7nTTqDWja4Z9MQduQEOHQax4DDrJqqvQuw EKXJyxlfTBJk+rtBwbcq/lOUNtESNAWplDx5w5VlWgDb0ClLvy5pHbixZEGrSwXRncYm l0VMVPTPqUAdxOrZD+eC3oHOQd8vSg/KSpidVjBeFoHXbB1jl7DWK8OdYlyVTiIi3OYL QcHAnXUtwH3zQSQTTE3QGhBGtvx4TNwm52zr1pJdtbNh9VmsY6PSDlGlLLIjwt8+qdFV S2KA== X-Forwarded-Encrypted: i=1; AJvYcCVKKZR2gAf1ubYUWeHg7S90mW2RUX0Op1DsnLBtSAIWFb2up5xLeGI/KlpcVgXeu0PU+d0t2VNb6TAgiFr4cenlrfnmvsvUdQ== X-Gm-Message-State: AOJu0YwLnLOXJpGmp4nwOUjGfWP/eh/UspyeCIk3ZCvHhknK83SVh3vP Ed8EzZKc+CvQCIi6l/Fb9aIUvhoyG/W2Q3R72LIvg8o1m3h6AhHdH6lCS9I+ X-Google-Smtp-Source: AGHT+IHZaaOpEzh9DKVO9Ex5QTZxZRP0WNhWQe26W9Ttx8b4Jg7kAXE63z8iCiXNap7LXm8w7csPFA== X-Received: by 2002:a05:6830:1e73:b0:6f2:5bc1:b7f2 with SMTP id 46e09a7af769-6f9434561ccmr4703337a34.17.1717641677286; Wed, 05 Jun 2024 19:41:17 -0700 (PDT) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com. [209.85.214.182]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6de2678c69bsm214128a12.71.2024.06.05.19.41.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Jun 2024 19:41:17 -0700 (PDT) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1f62217f806so4370405ad.2; Wed, 05 Jun 2024 19:41:17 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVwlAKLR+AJuvNlZI07lTW3i0FjhsdEMn5DlgfNDS3PtbTLMmbPcul0/ILK5LHH+YPVCXNctETzu42VikJpS34HBPMve7kVKQ== X-Received: by 2002:a17:902:ec86:b0:1f3:7a3:8fc9 with SMTP id d9443c01a7336-1f6a590b4damr56246155ad.3.1717641676915; Wed, 05 Jun 2024 19:41:16 -0700 (PDT) MIME-Version: 1.0 References: <20240522095404.1825269-1-syq@gcc.gnu.org> In-Reply-To: From: YunQiang Su Date: Thu, 6 Jun 2024 10:41:05 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] driver: Use -as/ld/objcopy as final fallback instead of native ones for cross To: YunQiang Su , gcc-patches@gcc.gnu.org, pinskia@gmail.com, jeffreyalaw@gmail.com, doko@debian.org, richard.sandiford@arm.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,BODY_8BITS,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: YunQiang Su =E4=BA=8E2024=E5=B9=B45=E6=9C=8829=E6=97=A5= =E5=91=A8=E4=B8=89 10:02=E5=86=99=E9=81=93=EF=BC=9A > > Richard Sandiford =E4=BA=8E2024=E5=B9=B45=E6= =9C=8829=E6=97=A5=E5=91=A8=E4=B8=89 05:28=E5=86=99=E9=81=93=EF=BC=9A > > > > YunQiang Su writes: > > > If `find_a_program` cannot find `as/ld/objcopy` and we are a cross to= olchain, > > > the final fallback is `as/ld` of system. In fact, we can have a try = with > > > -as/ld/objcopy before fallback to native as/ld/objcopy. > > > > > > This patch is derivatived from Debian's patch: > > > gcc-search-prefixed-as-ld.diff > > > > I'm probably making you repeat a previous discussion, sorry, but could > > you describe the use case in more detail? The current approach to > > handling cross toolchains has been used for many years. Presumably > > this patch is supporting a different way of organising things, > > but I wasn't sure from the description what it was. > > > > AIUI, we currently assume that cross as, ld and objcopy will be > > installed under those names in $prefix/$target_alias/bin (aka $tooldir/= bin). > > E.g.: > > > > bin/aarch64-elf-as =3D aarch64-elf/bin/as > > > > GCC should then find as in aarch64-elf/bin. > > > > Is that not true in your case? > > > > Yes. This patch is only about the final fallback. I mean aarch64-elf/bin/= as > still has higher priority than bin/aarch64-elf-as. > > In the current code, we find gas with: > /prefix/aarch64-elf/bin/as > $PATH/as > > And this patch a new one between them: > /prefix/aarch64-elf/bin/as > $PATH/aarch64-elf-as > $PATH/as > > > To be clear, I'm not saying the patch is wrong. I'm just trying to > > understand why the patch is needed. > > > > Yes. If gcc is configured correctly, it is not so useful. > In some case for some lazy user, it may be useful, > for example, the binutils installed into different prefix with libc etc. > > For example, binutils is installed into /usr/aarch64-elf/bin, while > libc is installed into /usr/local/aarch64-elf/. > Any idea about it? Is it a use case making sense?