From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by sourceware.org (Postfix) with ESMTPS id CB4B53858405 for ; Thu, 28 Oct 2021 14:43:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CB4B53858405 Received: by mail-pj1-x1034.google.com with SMTP id om14so4852572pjb.5 for ; Thu, 28 Oct 2021 07:43:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=BCSSL+rMQ8VBxiYzUpXVfo2xdAZxNeSUbbADt2xH+3Y=; b=rS0lF3WTHEZPhtmC9quw4D4yqvBHl4w2MNxYNZpxICFuQXfSd/zRYseKRK9/4yepmW 8Uo3lvpI5X8R8lsE7tVvUC0lFdtwGZU45krVTbt0f2yGR/6NEK97AE3vgrJ5hAVX6Oru /4o3lFfXNCKPvKGnG1G0KdMp62RPAvkmHHr5sKROI+wdLKGWjBgw29dUKtgfrrnB4kl0 UJLjobae9N9yCRu51n63qT2KE3agV6Br1pZNb1+yBJG0elRGplICocApRk3/kvqvMnwA HHWcUl6s1D/iUe9jBKHikZZFRn9SHTTP6YadCcFsbldgYbic065aytEwVVqiFo5aPCLb +7sg== X-Gm-Message-State: AOAM533vsmMX+BZ0kImcgrBBCi4JdzZyGVETtu64eiN31YeXvIl2/xHY iLKyDfe/ZbWgsgO0xIqnISf6oElFhQ0= X-Google-Smtp-Source: ABdhPJz9HFaVwcYj4u/WqShGTVoj3YckyJ8+KweS9Nml6tkGai6BtAt+eB6cQk8oACT3TPoIKlpSyQ== X-Received: by 2002:a17:902:6bc8:b0:13f:8a54:1188 with SMTP id m8-20020a1709026bc800b0013f8a541188mr4291623plt.49.1635432235436; Thu, 28 Oct 2021 07:43:55 -0700 (PDT) Received: from [172.31.0.175] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id pi9sm3609860pjb.31.2021.10.28.07.43.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Oct 2021 07:43:55 -0700 (PDT) Subject: Re: [PATCH 1/5] Makefile.in: Ensure build CPP/CPPFLAGS is used for build targets To: Richard Biener , Richard Purdie Cc: GCC Patches References: <20211027200505.3340725-1-richard.purdie@linuxfoundation.org> <20211027200505.3340725-2-richard.purdie@linuxfoundation.org> From: Jeff Law Message-ID: <14729289-0fec-303d-50aa-986430178b5e@gmail.com> Date: Thu, 28 Oct 2021 08:43:53 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2021 14:43:58 -0000 On 10/28/2021 1:04 AM, Richard Biener via Gcc-patches wrote: > On Wed, Oct 27, 2021 at 10:10 PM Richard Purdie via Gcc-patches > wrote: >> During cross compiling, CPP is being set to the target compiler even for >> build targets. As an example, when building a cross compiler targetting >> mingw, the config.log for libiberty in >> build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log >> shows: >> >> configure:3786: checking how to run the C preprocessor >> configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=[sysroot]/x86_64-nativesdk-mingw32-pokysdk-mingw32 >> configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=[sysroot]/x86_64-nativesdk-mingw32-pokysdk-mingw32 conftest.c >> configure:3876: $? = 0 >> >> This is libiberty being built for the build environment, not the target one >> (i.e. in build-x86_64-linux). As such it should be using the build environment's >> gcc and not the target one. In the mingw case the system headers are quite >> different leading to build failures related to not being able to include a >> process.h file for pem-unix.c. >> >> Further analysis shows the same issue occuring for CPPFLAGS too. >> >> Fix this by adding support for CPP_FOR_BUILD and CPPFLAGS_FOR_BUILD which >> for example, avoids mixing the mingw headers for host binaries on linux >> systems. > OK. I don't think Richard P. has write access, so I went ahead and pushed this to the trunk. jeff