From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id 979313857C54 for ; Mon, 24 Aug 2020 19:41:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 979313857C54 Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-212-4vy_RGFGO3iBv6kZke_61A-1; Mon, 24 Aug 2020 15:41:23 -0400 X-MC-Unique: 4vy_RGFGO3iBv6kZke_61A-1 Received: by mail-pf1-f200.google.com with SMTP id b142so6644087pfb.9 for ; Mon, 24 Aug 2020 12:41:23 -0700 (PDT) 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=TLHohRoB5blejk8Toyq0ZQDfmkxGJ2BIgAGLTIUm+W0=; b=E53ouVO1+8kFfP0+8ZKtGIIZSoXVPjPh6STex10Vt50EYWNwJZ9U8a/XRyBaADXlA9 5NlXllkPObq4B9+dbJF3UnZYxrRE6XbfsdFKTWnk9gdUPzAyOJt6NzMmob7xq5JAnC42 al2UOWMrr4TyVClJAnzrC+8BsLIArcgrLWwfJ99XhBsOIVVar1B9BvSmsSo4D+ZjuR8k 8kso+55eDwbxEzXCpQw10zZtAEuiB7j+6dxz7+Kp+u4Qojms0fX+xqGFgESjh/w9UHzV xNgO+Tlfs3HzV3Y0BwXCXopdTdcePSY7GoImZ2TPBNhDpBmEL04OgLoApH+0a4vPWuKm abZg== X-Gm-Message-State: AOAM530q3fbZEMFMvtxtnCsMihOZg9TaVp5TX6bamT8ZHkUedI+krwpT Ej0YVbTkucdUCSTyEToKwqlmHu2U+p4hv7lnpc5pxaIoD5smRdk3K85XyiWkuyk+OL3DivsCmfp oDIrG1j3gsnGy5LXLPPKo8UrvyNViTOI= X-Received: by 2002:a17:902:c286:: with SMTP id i6mr4627624pld.219.1598298082386; Mon, 24 Aug 2020 12:41:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkRrL4JzP3GtDdXRRTTcSKTU35PFXkYIgaVMZmvhMd6U3DmuA36nqWnAkZGGjHthwAct55KdNXYlel8ic8xEU= X-Received: by 2002:a17:902:c286:: with SMTP id i6mr4627610pld.219.1598298082129; Mon, 24 Aug 2020 12:41:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jeff Johnston Date: Mon, 24 Aug 2020 15:41:11 -0400 Message-ID: Subject: Re: compiling newlib To: Paul Zimmermann Cc: Newlib X-Mimecast-Spam-Score: 0.0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 19:41:33 -0000 Responses below: On Fri, Aug 21, 2020 at 4:21 AM Paul Zimmermann wrote: > Hi, > > I am new to this list. I have two questions: > > 1) I have a file newlib/libm/libm.a, that I have downloaded somewhere, but > I don't remember where. I'd like to know to which version of newlib it > corresponds. Is there a way to do this? > > Offhand, I don't know how to tell this. It does bring up a good point that we should have the version embedded in the .a files somewhere. 2) I downloaded newlib-3.3.0 from ftp://sourceware.org/pub/newlib/, > but I am unable to compile it on x86_64 under Linux. > Here is what I did: > $ tar xf /tmp/newlib-3.3.0.tar.gz > $ cd newlib-3.3.0 > $ mkdir build > $ cd build > $ ../configure --prefix=/tmp # runs ok > $ make > > The make command returns almost immediately, and there is no libm.a > file created. > This is because by default you cannot build newlib natively - it must be a cross-build (usually native users use glibc). You can force build newlib for linux on x86_64 by specifying --with-newlib but this may not be working lately (newlib for native linux shares headers between newlib and locally installed headers so it gets broken easily when local headers change). If you want to play with building newlib, you want to have some gnu cross tools installed or built locally (e.g. aarch64-elf, m32-elf, etc..). You can download one for arm here: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads > I tried also the following: > $ tar xf /tmp/newlib-3.3.0.tar.gz > $ cd newlib-3.3.0 > $ mkdir build > $ cd build > $ ../configure --prefix=/tmp --target=x86_64 > $ make > > Then make seems to do more job, however it fails with: > > /bin/bash: line 2: x86_64-ar: command not found > > The tools used for the cross-build are constructed from your target. If you specify x86_64-elf then it will look for x86_64-elf-ar, x86_64-elf-gcc, etc.. in your path. Note: item 1 of the FAQ on https://sourceware.org/newlib/ refers to > ${FULL_PATH_TO_SRC}/src/configure --prefix=`pwd` --target=XXX but there > is no src directory in the newlib-3.3.0.tar.gz tarball. > > That is a mistake. What am I doing wrong? > Nothing. It is a bit of a learning experience. You can try reading the README and the faq on sourceware.org/newlib to get some other information. -- Jeff J. > Best regards, > Paul Zimmermann > > >