From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 87BBD3858D28 for ; Tue, 14 Dec 2021 23:11:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 87BBD3858D28 Received: by mail-pl1-x630.google.com with SMTP id m24so14786153pls.10 for ; Tue, 14 Dec 2021 15:11:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=W7PDSk/9AhC73GF9c9kT8u8T9kJINf4w5YR4h6ivPlI=; b=CFxzAwYj6XGBSwbXaHijUGUK+ff/gin0AJ6CJf69LIFe3Rjy4ZHeWZgpWSfHMtKjP+ yoSU9DgoicGeOygnuPEB4SIVHwATgbRSebwDcwlOIrSQgD0G1yljShw7I/woCoARHNHb U2//ANFy0WmsQ9XJHj3S4ssIa5HMBzMoPPg9RlyRsYRn9BV6vg4SDW8MzY1RT41VZADs Jzdyx1EyNcddE41VAo8JlqEV0PTwW83jCa2qgJMJpTQqiMXYcuNsAKkRiMRr4UwQa1/t HoHZVfADmn7OJyoPtBHnnEi6tZ64KbX/EKFLwYd+rHWAYo9dOsQ9sDOYqoUHV5YNM5N2 f99g== X-Gm-Message-State: AOAM531+56/BTjCpLIp3IWxrk1lCq4Ga4BIrdz/Emd04o7wJRI/57aLK SsNuBMudQnjnWb8ihJsMq3RJ3paqybCkyA== X-Google-Smtp-Source: ABdhPJxKGYxpPn1vOPVFbs0rvY+fby1reyWgPpI7oXEvZIFtdYdTNzVFxrQc/+yyygjEV2WmxPjhaQ== X-Received: by 2002:a17:902:b710:b0:148:a2e8:27a2 with SMTP id d16-20020a170902b71000b00148a2e827a2mr1684711pls.169.1639523459691; Tue, 14 Dec 2021 15:10:59 -0800 (PST) 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 ml24sm57834pjb.16.2021.12.14.15.10.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Dec 2021 15:10:59 -0800 (PST) Message-ID: <55fc0317-b022-244a-1228-70927289eb0f@gmail.com> Date: Tue, 14 Dec 2021 16:10:58 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH] stddef.h: add support for musl typedef macro guards Content-Language: en-US To: =?UTF-8?Q?S=c3=b6ren_Tempel?= Cc: gcc-patches@gcc.gnu.org References: <20211126165717.9729-1-soeren@soeren-tempel.net> <7da617fe-bf76-fd57-b32b-0688ac8795ac@gmail.com> <3LNI9X4XOTA5O.3JKS4FGJD3ULO@8pit.net> From: Jeff Law In-Reply-To: <3LNI9X4XOTA5O.3JKS4FGJD3ULO@8pit.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 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: Tue, 14 Dec 2021 23:11:02 -0000 On 12/2/2021 11:24 PM, Sören Tempel wrote: > Hi, > > Jeff Law wrote: >> So what doesn't make sense here is how both stddef.h files get >> included.  That's the core problem I think you need to resolve. > The libgo/sysinfo.c file includes stddef.h (for which the GCC version in > ginclude is used on my system) and stdlib.h which, on musl, causes an > include of /usr/include/bits/alltypes.h [1] which then defines size_t > and other types, which were already defined by GCC's stddef.h, again [2]. > > As such, both stddef.h files are actually not included, i.e. only the > GCC one is used. The alternative here would be to have libgo/sysinfo.c > include the stddef.h provide by the systemc libc but not sure if that is > intended here. I am personally not very familiar with the GCC codebase. > > I can send you a pre-processed version of sysinfo.c if you want to > reproduce this yourself. Thanks.  What was confusing was the original explanation indicated it was two different versions of stddef.h being included, when in fact it was stddef.h (from gcc) and stdlib.h (from musl) getting included that caused the problem. I replaced the instance of stddef.h with stdlib.h in the original explanation and included that in the commit log when I pushed this fix to the trunk. Thanks for your patience, Jeff