From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 6EB543858D28 for ; Fri, 8 Apr 2022 14:05:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6EB543858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=foss.arm.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=foss.arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 29DE8113E; Fri, 8 Apr 2022 07:05:43 -0700 (PDT) Received: from [10.57.40.209] (unknown [10.57.40.209]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A4C893F73B; Fri, 8 Apr 2022 07:05:42 -0700 (PDT) Message-ID: Date: Fri, 8 Apr 2022 15:05:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: cannot find crt0.o file Content-Language: en-GB To: Dalas Yoo , newlib@sourceware.org References: From: Richard Earnshaw In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3492.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: 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: Fri, 08 Apr 2022 14:05:44 -0000 On 25/03/2022 10:30, Dalas Yoo wrote: > Hello, I tried to build a newlib for cross-compile toolchain. > > I configured it as below. > > ../newlib/configure --disable-newlib-io-float > --disable-newlib-supplied-syscalls --target=arm-none-eabi > > With the configuration, the newlib was successfully built. But when trying > to compile and link the program, the arm-none-eabi-gcc prints error "crt0.o > not found". > When searching the newlib lib directory, crt0.o file is not found though > other types of crt0.o are found such as rdimon-crt0.o. > > If the arm-none-eabi-gcc gets applied with --specs=rdimon.specs options, it > compiles the program fine. > But if the newlib is configured without --disable-newlib-supplied-syscalls, > it normally generates crt0.o. > > Would there be any suggestions on this case? > Thanks, > Dalas Newlib is constructed in a way that allows significant customization for different boards. Most of that customization lives in libgloss (if you build newlib with the embedded syscalls then you lose all that ability to customize for your own platform). When you target the 'bare metal' for a specific board you will likely need to do your own customization and provide your own startup code to handle the very first few operations of your program. The code in libgloss can then act as a guide for what you need to do. In particular you will likely need to write a customized gcc driver script. Some examples come with libgloss, such as rdimon.specs which is a customization for using newlib with Arm's semihosting protocol. There are other examples, such as one using redboot as well. R.