From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by sourceware.org (Postfix) with ESMTPS id 5CB9F383F850 for ; Thu, 4 Mar 2021 19:58:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5CB9F383F850 Received: by mail-yb1-xb35.google.com with SMTP id m9so29845017ybk.8 for ; Thu, 04 Mar 2021 11:58:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=alIimgm3he327dQ1th9V+pbmvv2EguUfZEm8O2EpGjs=; b=UNDjy6WoTbYZf3AETln03bdzE8Wxt0ramOo4lJI353W+1v4UY7smpPr2BR0a9g3SHH hTFaWrifrBH7AhMGDzu+rIYnHpqXRES2lray9qxiUL+gzJkogIkp50zHj6Z8HHF2jNAT tiUSfuT4UY6PkprL+lkZ+tTt8OHK6APkdH9fsFjjuV+cf/CbzsuJ3Tf6GIDhJHxJx59h eSwwkO3PizvchsMkavyjKPFnqE6XG9sPjfHb4W7zO00bXY6KdF2ftFNU5Bfkt33ISEJ0 FH6zlzMXm3giWKYEZG8g5cEuEfgDQqiMuC4WM5TA5BIFoF8qyNZENZdyyHuTF+pqUs4b WtSw== X-Gm-Message-State: AOAM533hg5Z3wbrZv7juxfJxHLLfXDzOISg37LhVshEhXj+vT5Pf0YKa uaSokSSFrO/NVoWwY6x5pCtyBgCB762csWheitOXYQ== X-Google-Smtp-Source: ABdhPJzxbFIumWufmoWoPI3FWk0pER3PvppjqvgndLSk8ePEgKkYru9mtyjDiL/UNmCa2AHCngvq9p4HxXfWAsoUN+I= X-Received: by 2002:a25:d091:: with SMTP id h139mr7730385ybg.437.1614887930889; Thu, 04 Mar 2021 11:58:50 -0800 (PST) MIME-Version: 1.0 References: <87wnunnq3q.fsf@oldenburg.str.redhat.com> In-Reply-To: From: Adhemerval Zanella Date: Thu, 4 Mar 2021 16:58:40 -0300 Message-ID: Subject: Re: Directory structure of glibc and header files installed on Linux To: Peng Yu Cc: Florian Weimer , Peng Yu via Libc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:58:53 -0000 On Thu, Mar 4, 2021 at 1:56 PM Peng Yu wrote: > > Hi Adhemerval and Florian, > > > That's why the simplest solution is as Florian has put it to build a > > glibc to the target you want to > > inspect and check the installed headers. > > I don't understand this part. When it is installed, it does copies or > symlinks? If it is just copies, how to tell where they are originally > from? How to avoid the conflict between user installed libc vs the > system default installed libc (as. libc6-dev in debian lineage)? It always copy, there is no symlink involved in the installation. Also, there is nothing preventing you to wreck your system by installing a glibc over the system one (you should not do it unless you know *exactly* what you are doing). The usual process of installing the glibc is during either a work rebuild on a sysroot (like Linux From Scratch does) or within a sysroot (like build-many-glibcs.py does). > > Do you have to build glibc before running build-many-glibcs.py? How to > run build-many-glibcs.py? It seems that it have options. I am not sure > what options I should use. Could you show me the complete command? The build-many-glibcs.py requires some tools, like a working gcc, python3, bison, and the other usual tools required to build gcc and glibc. The simplest way to use is: (1) glibc-git$ ./scripts/build-many-glibcs.py checkout /path/to/place/source/and/binaries (2) glibc-git$ ./scripts/build-many-glibcs.py host-libraries (3) glibc-git$ ./scripts/build-many-glibcs.py compilers x86_64-linux-gnu (4) glibc-git$ ./scripts/build-many-glibcs.py glibcs x86_64-linux-gnu The (1) will download the required source (binutils, linux, gcc, glibc, math libraries), (2) will build the math libraries used in gcc built, (3) will build a bootstrap compiler targetting x86_64-linux-gnu, and finally (4) will build a glibc using the bootstrap compiler built. > > Does macOS use glibc? No, macOS uses its own libc implementation. And there is no glibc support for macOS, neither in plan. > > On macOS, I see this. > > $ gcc -E -dD - <<< '#include ' |grep '^#define SOL_' > #define SOL_SOCKET 0xffff > > On Linux, I see this. Is that macOS uses a completely different libc > library? Or glibc has a specific target for macOS? Yes, macOS uses https://opensource.apple.com/source/Libc/ > > $ gcc -E -dD - <<< '#include ' |grep '^#define SOL_' > #define SOL_RAW 255 > #define SOL_DECNET 261 > #define SOL_X25 262 > #define SOL_PACKET 263 > #define SOL_ATM 264 > #define SOL_AAL 265 > #define SOL_IRDA 266 > #define SOL_NETBEUI 267 > #define SOL_LLC 268 > #define SOL_DCCP 269 > #define SOL_NETLINK 270 > #define SOL_TIPC 271 > #define SOL_RXRPC 272 > #define SOL_PPPOL2TP 273 > #define SOL_BLUETOOTH 274 > #define SOL_PNPIPE 275 > #define SOL_RDS 276 > #define SOL_IUCV 277 > #define SOL_CAIF 278 > #define SOL_ALG 279 > #define SOL_NFC 280 > #define SOL_KCM 281 > #define SOL_TLS 282 > #define SOL_XDP 283 > #define SOL_SOCKET 1 > > -- > Regards, > Peng