From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com [209.85.128.176]) by sourceware.org (Postfix) with ESMTPS id 3CCB43858C98; Sat, 22 Jun 2024 06:21:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3CCB43858C98 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 3CCB43858C98 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.128.176 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719037276; cv=none; b=WS+T1DabMFihKlkFy5UCWIWHaizQ+Ep8yBLM00ljrsS/MhwNMQhsoJvM0gjsNTPKAzE2oUrWMeAxBvdIFrYpvjIvbNmktz9jT8qWzDuVJJ68PAoMidaFKRNdA7Pw4iBitUfoByoYgDqVxLJUkjIdKBnqdEcis8SifGkREp458Nw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719037276; c=relaxed/simple; bh=Jd2jpUQZYYoAXVPrU1soGdIJs8T0u7QPGYHiShhcNNA=; h=MIME-Version:From:Date:Message-ID:Subject:To; b=KTBzoWI5WtWZRuQJXOLeX190HDGyQu939OjwFkX5R1iJsXtzHgQ8nnUoxXItUsYrv/X34DF/8hfYUxDVQPn/mA8NT1GunYJvU/SsJQx24h7UA9xkngdog+GzBclrMlBN0yR1KmqNEkVYBcqUTG75faMA3QBLStsZXQfQpNggvXg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-630daaec9c7so25896737b3.1; Fri, 21 Jun 2024 23:21:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719037274; x=1719642074; h=content-transfer-encoding:cc: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=4tpZGJ1oGnDEQQnECCYvqQUD/o1/zazfGDwn9C98k90=; b=Esjw6yOE7Wd0+iz71G9/NUmnCT8h842Ja2B8ggf8KEymg7wWoAEjnxxxrsFYB97ZIh DlZJ0IkcxmTCwyiyli3cu/LiNL+EwmN1eG/Q9U1VwkpcMGXWJ9IZg4/ucteYHWL85FBS zGNZzVXFQsnmqMfeBW9dlqEUJjXSBsWWFV/v2GP4RtVHPm7Vx24FYfwJ0l3fu4wFlELA Xc5g33gSDHHc3/lRibNnAqgDMcsENQRF66dL5CyN42AxCoreL+vc8jVuLABLwuO2nium d89ohDYV9N3uCvMfHAMtBx8dSaAMfW0NO8aoTWzBnKKj5uOXD1cglV0D5MqkV0PKTe9w M78A== X-Forwarded-Encrypted: i=1; AJvYcCUlABQQu4Pg1wduIWEomL0X+UEBpdv/4QcX7ceoe90XTpBPaAwXZ9+SrxEFqiIW7WGI9Lsz3x863BGH3bTUl0trSM8= X-Gm-Message-State: AOJu0Yx1kG2XzW6XlJVNYuB7f7GetaDeUlCHHuXS3MDn250mblh+ik8i zSbPG1Ydp3rw2baBQyk6WKr8FCDufqJsndowyKrYKuk1OkG9jO4OeOtDtAWOfUA= X-Google-Smtp-Source: AGHT+IHeiQ+Hph5aLBHylZBBI1qV8k2ie++t/JW9Tel2XRk4+0GBzmqUigBSfE4oKtnRqwa+LS9L6g== X-Received: by 2002:a0d:d44b:0:b0:632:b398:9f41 with SMTP id 00721157ae682-63a8faf160cmr110954417b3.35.1719037274348; Fri, 21 Jun 2024 23:21:14 -0700 (PDT) Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com. [209.85.219.181]) by smtp.gmail.com with ESMTPSA id 00721157ae682-63f1269bbf3sm10039647b3.64.2024.06.21.23.21.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Jun 2024 23:21:14 -0700 (PDT) Received: by mail-yb1-f181.google.com with SMTP id 3f1490d57ef6-dff17fd97b3so2665559276.2; Fri, 21 Jun 2024 23:21:14 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUgRZ2N5d/6biAjQZFNCrjG/R0gCcRD+WeLOFEq4a9Lv0B8XobDQL9n8uSRjAxssJumRhw9bgYf5pAzo751dLFKK2M= X-Received: by 2002:a25:18b:0:b0:e02:b4ad:10c4 with SMTP id 3f1490d57ef6-e02be10becbmr11611705276.8.1719037273796; Fri, 21 Jun 2024 23:21:13 -0700 (PDT) MIME-Version: 1.0 References: <20240614121218.63375-1-syq@gcc.gnu.org> In-Reply-To: <20240614121218.63375-1-syq@gcc.gnu.org> From: YunQiang Su Date: Sat, 22 Jun 2024 14:21:02 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Build/Cross: Look for target headers from include if sys-include doesn't exist To: gcc-patches@gcc.gnu.org Cc: marcuscalhounlopez@gmail.com, sjames@gcc.gnu.org, jeffreyalaw@gmail.com, richard.sandiford@arm.com, doko@debian.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 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_H2,SPF_HELO_NONE,SPF_PASS,TXREP 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=B46=E6=9C=8814=E6=97=A5= =E5=91=A8=E4=BA=94 20:12=E5=86=99=E9=81=93=EF=BC=9A > > PR 115416 > > When we build a cross toolchain, while without --with-sysroot, > target headers are expected in > ${test_exec_prefix}/${target_noncanonical}/sys-include > while it is true only with --with-headers option is used. In other > cases, the path should be > ${test_exec_prefix}/${target_noncanonical}/include > such as Debian's cross toolchain. > > Debian's cross toolchain has directory structures like: > /usr//lib > /include > /bin/ > > For this case, we cannot use "--prefix=3D/usr --with-sysroot=3D/", as > gcc/configure will use headers of build, aka in /usr/include to detect > features. And fixinclude also uses the headers of build. > > Let's use the `include` if `sys-include` doesn't exist. > > For Makefile.in, the compare @includedir@ and $(prefix)/include is not > correct, as the --includedir option is used to set where the headers > should be installed. > > gcc: > PR 115415. > configure.ac: Set target_header_dir and CROSS_SYSTEM_HEADER_DIR > to ${test_exec_prefix}/${target_noncanonical}/include when cross > and without --with-sysroot and without --with-headers. > configure: Regenerate. > Makefile.in: Set CROSS_SYSTEM_HEADER_DIR as configure, and don't > compare @includedir@ and $(prefix)/include. > --- > gcc/Makefile.in | 6 +----- > gcc/configure | 8 ++++++-- > gcc/configure.ac | 4 ++++ > 3 files changed, 11 insertions(+), 7 deletions(-) > Gently ping.