From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by sourceware.org (Postfix) with ESMTPS id 41215385700E for ; Tue, 3 Nov 2020 11:08:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 41215385700E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ivanov.email Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vlad@ivanov.email Received: from mxback4o.mail.yandex.net (mxback4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1e]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 7E0DE1C82FF8 for ; Tue, 3 Nov 2020 14:08:03 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback4o.mail.yandex.net (mxback/Yandex) with ESMTP id G0ocMt2YxE-83PqQnTD; Tue, 03 Nov 2020 14:08:03 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ivanov.email; s=mail; t=1604401683; bh=ECRLrBBHPbf5pPfIOBAnQvSTZtfrEldMVRXOh/2FkcQ=; h=Message-Id:Date:Subject:To:From; b=pBlc2kKE9a2oESpcQmH1XKRkiyFHuXS7M7d3Zz2K6eV/oZGL3A7KZlt7WfwJRaChK ISP9z2C8KSm8pGw0PRXl+ziLlqiyE6aESm6ROeQkNTrkNWEok7Mq8GUxdytCKv9YAG qzT4VtXzoSHJrZxC7XIH61GX4x6+D4qfRwuyV5/M= Authentication-Results: mxback4o.mail.yandex.net; dkim=pass header.i=@ivanov.email Received: by iva2-15a880c55b23.qloud-c.yandex.net with HTTP; Tue, 03 Nov 2020 14:08:02 +0300 From: Vlad Ivanov To: "newlib@sourceware.org" Subject: Configuring newlib for cross-compilation with clang MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 03 Nov 2020 14:08:02 +0300 Message-Id: <2582251604400981@mail.yandex.ru> Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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: 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: Tue, 03 Nov 2020 11:08:14 -0000 Hello, I'm trying to build newlib for a PowerPC embedded target to assemble a complete toolchain with clang. I need to use clang as a cross compiler; clang and llvm are the only tools available. The resulting toolchain targets bare metal environment. Here's the command I'm using: ../newlib-cygwin/configure \ --prefix=/opt/newlib-powerpc/install \ --disable-libstdcxx \ --disable-shared \ --enable-static \ --disable-multilib \ --target=powerpc-none-eabi \ --disable-newlib-supplied-syscalls \ --enable-newlib-nano-malloc \ --enable-target-optspace \ --disable-newlib-multithread \ --disable-newlib-io-float \ --enable-lite-exit \ CC='/usr/bin/clang' CFLAGS='--target=powerpc-none-eabi' I see an error early during configuration: checking for C compiler default output file name... configure: error: in `/opt/newlib-powerpc/build': configure: error: C compiler cannot create executables See `config.log' for more details. Now, this error occurs because the configure script tries to compile an executable and it's expecting to see something like a.out. But for an embedded target, to link an executable, one needs a linker scripts to define the memory layout, since there's no OS loading the binary. So any tests that create executables will fail. Is it possible to tell newlib to not compile any executables? Or should I use something like a dummy linker script? Best Regards, Vlad