This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Compiling newlib for the [sparc-leon3-elf] target
- From: Jeff Johnston <jjohnstn at redhat dot com>
- To: Orlando Arias <orlandoarias at gmail dot com>
- Cc: newlib at sourceware dot org
- Date: Mon, 9 Jan 2017 12:13:59 -0500 (EST)
- Subject: Re: Compiling newlib for the [sparc-leon3-elf] target
- Authentication-results: sourceware.org; auth=none
- References: <48216d8d-e748-a300-aebe-b449427ced9c@gmail.com>
>From your configuration below, you are configuring your gcc as
disable-multilib.
The way newlib generates the various subdirectories is to call
gcc --print-multi-lib and then parse the output into sub-directories
and what options are to be used when building in said sub-directories.
If you run your cross-compiler with --print-multi-lib you can see
what newlib will use. If there are no multilibs, then newlib won't
do what you want.
-- Jeff J.
----- Original Message -----
> Greetings,
>
> I have been trying to build the newlib/libgloss stack and associated
> libraries for the sparc-leon3-elf package. Currently, I am using a
> slightly patched binutils and gcc to perform this process. The patches
> can be found in [1]. The patches are supposed to add the missing linker
> script in binutils and change the default linker command gcc issues for
> the sparc-elf target.
>
> The situation I am having when building newlib is specifically with the
> libraries associated for the leon3. An old build by Gaisler generates a
> few separate directories:
>
> lib/
> lib/soft/
> lib/soft/v8
> lib/ut699
> lib/v8
> lib/v8/ut699
>
> each with separate versions of the C runtime, AMBA plug and play
> routines, the baremetal leon3 libraries. However, when I build it, none
> of these directories get created, and the resulting leon3 libraries
> begin exposing duplicate symbols [as if what should be in independent
> directories are merged into the same file]. When linking programs, ld is
> right to complain about the situation and generates no binaries.
>
> I am configuring newlib/libgloss with:
>
> export _target=sparc-leon3-elf
> export CFLAGS_FOR_TARGET="-Os -g -ffunction-sections -fdata-sections"
> export CFLAGS=${CFLAGS_FOR_TARGET}
>
> ../configure \
> --prefix=/usr \
> --target=${_target} \
> --with-cpu=leon3 \
> --enable-multilib \
> --with-sysroot=/usr/${_target}
>
> Binutils [2.27 with linked patches] was configured with:
> ../configure --prefix=/usr \
> --target=${_target} \
> --with-program-prefix=${_target}- \
> --with-sysroot=/usr/${_target} \
> --enable-shared \
> --disable-nls \
> --with-gnu-as \
> --with-gnu-ld \
> --enable-plugins \
> --disable-gold \
> --enable-multilib \
> --with-cpu=leon3 \
> --with-float=soft \
> --disable-werror
> make configure-host
> make
>
> GCC [6.3.0 with linked patches] was bootstrapped as:
> ../configure \
> --target=${_target} \
> --with-sysroot=/usr/${_target} \
> --prefix=/usr \
> --enable-languages=c \
> --disable-shared \
> --disable-nls \
> --disable-threads \
> --disable-libgomp \
> --disable-mudflap \
> --disable-libssp \
> --disable-multilib \
> --with-float=soft \
> --with-newlib \
> --without-headers \
> --with-float=soft \
> --with-cpu=leon
>
> make all-gcc
>
> Any ideas what I could be missing here? Thank you.
>
> Cheers,
> Orlando.
>
> [1]
> https://beta.groups.yahoo.com/neo/groups/LEON_SPARC/conversations/messages/24660
>
>