Configuring newlib for cross-compilation with clang

Vlad Ivanov <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.