public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* Newlib cross-compiling issue
@ 2016-12-11 21:12 Alexander Kurakin via newlib
       [not found] ` <221861229.4241353.1481842367211.JavaMail.zimbra@redhat.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Kurakin via newlib @ 2016-12-11 21:12 UTC (permalink / raw)
  To: newlib

Good day!

I'm trying to compile Newlib for STM32F4DISCOVERY. My system is Ubuntu 14.04 x86_64, my toolchain is ARM GCC Embedded toolchain [1] (so compiler is arm-none-eabi-gcc).

How do I configure and compile? Show me a command, please?

(Sure) I've done some actions but they are all unsuccessful. Most often cases (while playing with --target, --host, --build) are:
*  unrecognized target machine,
*  host compiler is used instead of target while "compiler checking" (and it doesn't recognize ARM-specific options),
*  (target compiler is used and) executable format error.

CFLAGS I add: -DPREFER_SIZE_OVER_SPEED -mfloat-abi=softfp -mcpu=cortex-m4 -mthumb
Switches I add: --disable-libquadmath --disable-libquadmath-support --disable-libstdcxx --disable-newlib-fvwrite-in-streamio --disable-newlib-fseek-optimization --disable-newlib-wide-orient --disable-newlib-unbuf-stream-opt --disable-multilib --disable-newlib-multithread --disable-newlib-io-float --disable-newlib-supplied-syscalls

Thanks!

-- 
Alexander Kurakin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re[2]: Newlib cross-compiling issue
       [not found] ` <221861229.4241353.1481842367211.JavaMail.zimbra@redhat.com>
@ 2016-12-18 11:36   ` Alexander Kurakin via newlib
  2016-12-19 11:12     ` Freddie Chopin
  2017-01-04 20:31     ` Jeff Johnston
  0 siblings, 2 replies; 6+ messages in thread
From: Alexander Kurakin via newlib @ 2016-12-18 11:36 UTC (permalink / raw)
  To: newlib

Hi, Jeff! Thanks for reply!

Have looked now, but even with:

./configure \
 --target=arm-none-eabi \
 --with-cpu=cortex-m4 \
 --with-fpu=fpv4-sp-d16 \
 --with-float=hard \
 --with-mode=thumb \
...

I don't see something about cpu, arch, etc. in build log.

Typical call to compiler is:
arm-none-eabi-gcc -B./arm-none-eabi/newlib/ -isystem ./arm-none-eabi/newlib/targ-include -isystem /home/sasha/1/newlib-2.1.0/newlib/libc/include -B./arm-none-eabi/libgloss/arm -L./arm-none-eabi/libgloss/libnosys -L/home/sasha/1/newlib-2.1.0/libgloss/arm -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"newlib\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I../../../../../../newlib-2.1.0/newlib/libm/machine/arm -I ../../../../../../newlib-2.1.0/newlib/libm/machine/arm/../../../../newlib/libm/common -D__SINGLE_THREAD__ -D__NO_SYSCALLS__ -DNO_FLOATING_POINT -fno-builtin -g -O2 -c -o lib_a-s_floor.o `test -f 's_floor.c' || echo '../../../../../../newlib-2.1.0/newlib/libm/machine/arm/'`s_floor.c

Thanks!


-- 
Alexander Kurakin

>Пятница, 16 декабря 2016, 1:52 +03:00 от Jeff Johnston <jjohnstn@redhat.com>:
>
>Hi Alexander,
>
>Have you looked at:  https://istarc.wordpress.com/2014/07/21/stm32f4-build-your-toolchain-from-scratch/ ?
>
>-- Jeff J.
>
>----- Original Message -----
>> Good day!
>> 
>> I'm trying to compile Newlib for STM32F4DISCOVERY. My system is Ubuntu 14.04
>> x86_64, my toolchain is ARM GCC Embedded toolchain [1] (so compiler is
>> arm-none-eabi-gcc).
>> 
>> How do I configure and compile? Show me a command, please?
>> 
>> (Sure) I've done some actions but they are all unsuccessful. Most often cases
>> (while playing with --target, --host, --build) are:
>> *  unrecognized target machine,
>> *  host compiler is used instead of target while "compiler checking" (and it
>> doesn't recognize ARM-specific options),
>> *  (target compiler is used and) executable format error.
>> 
>> CFLAGS I add: -DPREFER_SIZE_OVER_SPEED -mfloat-abi=softfp -mcpu=cortex-m4
>> -mthumb
>> Switches I add: --disable-libquadmath --disable-libquadmath-support
>> --disable-libstdcxx --disable-newlib-fvwrite-in-streamio
>> --disable-newlib-fseek-optimization --disable-newlib-wide-orient
>> --disable-newlib-unbuf-stream-opt --disable-multilib
>> --disable-newlib-multithread --disable-newlib-io-float
>> --disable-newlib-supplied-syscalls
>> 
>> Thanks!
>> 
>> --
>> Alexander Kurakin


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re[2]: Newlib cross-compiling issue
  2016-12-18 11:36   ` Re[2]: " Alexander Kurakin via newlib
@ 2016-12-19 11:12     ` Freddie Chopin
  2017-01-04 20:31     ` Jeff Johnston
  1 sibling, 0 replies; 6+ messages in thread
From: Freddie Chopin @ 2016-12-19 11:12 UTC (permalink / raw)
  To: newlib

On Sun, 2016-12-18 at 14:36 +0300, Alexander Kurakin via newlib wrote:
> Hi, Jeff! Thanks for reply!
> 
> Have looked now, but even with:
> 
> ./configure \
>  --target=arm-none-eabi \
>  --with-cpu=cortex-m4 \
>  --with-fpu=fpv4-sp-d16 \
>  --with-float=hard \
>  --with-mode=thumb \
> ...
> 
> I don't see something about cpu, arch, etc. in build log.
> 
> Typical call to compiler is:
> arm-none-eabi-gcc -B./arm-none-eabi/newlib/ -isystem ./arm-none-
> eabi/newlib/targ-include -isystem /home/sasha/1/newlib-
> 2.1.0/newlib/libc/include -B./arm-none-eabi/libgloss/arm -L./arm-
> none-eabi/libgloss/libnosys -L/home/sasha/1/newlib-2.1.0/libgloss/arm 
> -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\"
> -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"newlib\ 2.1.0\"
> -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I.
> -I../../../../../../newlib-2.1.0/newlib/libm/machine/arm -I
> ../../../../../../newlib-
> 2.1.0/newlib/libm/machine/arm/../../../../newlib/libm/common
> -D__SINGLE_THREAD__ -D__NO_SYSCALLS__ -DNO_FLOATING_POINT -fno-
> builtin -g -O2 -c -o lib_a-s_floor.o `test -f 's_floor.c' || echo
> '../../../../../../newlib-2.1.0/newlib/libm/machine/arm/'`s_floor.c
> 
> Thanks!

You can check my script to build a complete toolchain, including newlib
in "standard" and "nano" variants.

https://github.com/FreddieChopin/bleeding-edge-toolchain

It works on Ubuntu if you install the packages mentioned in README.md.
If you have any issues using / understanding it - please let me know.

Regards,
FCh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re[2]: Newlib cross-compiling issue
  2016-12-18 11:36   ` Re[2]: " Alexander Kurakin via newlib
  2016-12-19 11:12     ` Freddie Chopin
@ 2017-01-04 20:31     ` Jeff Johnston
  2017-01-04 21:29       ` Re[4]: " Alexander Kurakin via newlib
  1 sibling, 1 reply; 6+ messages in thread
From: Jeff Johnston @ 2017-01-04 20:31 UTC (permalink / raw)
  To: Alexander Kurakin; +Cc: newlib

Hi Alexander,

Newlib doesn't process the --with-cpu, --with-fpu, --with-float, and --with-mode
options in its configure.

To add specific newlib target options, you can do so when invoking make:

make all-target-newlib CFLAGS_FOR_TARGET="-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb ... 

-- Jeff J.

----- Original Message -----
> Hi, Jeff! Thanks for reply!
> 
> Have looked now, but even with:
> 
> ./configure \
>  --target=arm-none-eabi \
>  --with-cpu=cortex-m4 \
>  --with-fpu=fpv4-sp-d16 \
>  --with-float=hard \
>  --with-mode=thumb \
> ...
> 
> I don't see something about cpu, arch, etc. in build log.
> 
> Typical call to compiler is:
> arm-none-eabi-gcc -B./arm-none-eabi/newlib/ -isystem
> ./arm-none-eabi/newlib/targ-include -isystem
> /home/sasha/1/newlib-2.1.0/newlib/libc/include
> -B./arm-none-eabi/libgloss/arm -L./arm-none-eabi/libgloss/libnosys
> -L/home/sasha/1/newlib-2.1.0/libgloss/arm -DPACKAGE_NAME=\"newlib\"
> -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"2.1.0\"
> -DPACKAGE_STRING=\"newlib\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\"
> -DPACKAGE_URL=\"\" -I.
> -I../../../../../../newlib-2.1.0/newlib/libm/machine/arm -I
> ../../../../../../newlib-2.1.0/newlib/libm/machine/arm/../../../../newlib/libm/common
> -D__SINGLE_THREAD__ -D__NO_SYSCALLS__ -DNO_FLOATING_POINT -fno-builtin -g
> -O2 -c -o lib_a-s_floor.o `test -f 's_floor.c' || echo
> '../../../../../../newlib-2.1.0/newlib/libm/machine/arm/'`s_floor.c
> 
> Thanks!
> 
> 
> --
> Alexander Kurakin
> 
> >Пятница, 16 декабря 2016, 1:52 +03:00 от Jeff Johnston
> ><jjohnstn@redhat.com>:
> >
> >Hi Alexander,
> >
> >Have you looked at:
> >https://istarc.wordpress.com/2014/07/21/stm32f4-build-your-toolchain-from-scratch/
> >?
> >
> >-- Jeff J.
> >
> >----- Original Message -----
> >> Good day!
> >> 
> >> I'm trying to compile Newlib for STM32F4DISCOVERY. My system is Ubuntu
> >> 14.04
> >> x86_64, my toolchain is ARM GCC Embedded toolchain [1] (so compiler is
> >> arm-none-eabi-gcc).
> >> 
> >> How do I configure and compile? Show me a command, please?
> >> 
> >> (Sure) I've done some actions but they are all unsuccessful. Most often
> >> cases
> >> (while playing with --target, --host, --build) are:
> >> *  unrecognized target machine,
> >> *  host compiler is used instead of target while "compiler checking" (and
> >> it
> >> doesn't recognize ARM-specific options),
> >> *  (target compiler is used and) executable format error.
> >> 
> >> CFLAGS I add: -DPREFER_SIZE_OVER_SPEED -mfloat-abi=softfp -mcpu=cortex-m4
> >> -mthumb
> >> Switches I add: --disable-libquadmath --disable-libquadmath-support
> >> --disable-libstdcxx --disable-newlib-fvwrite-in-streamio
> >> --disable-newlib-fseek-optimization --disable-newlib-wide-orient
> >> --disable-newlib-unbuf-stream-opt --disable-multilib
> >> --disable-newlib-multithread --disable-newlib-io-float
> >> --disable-newlib-supplied-syscalls
> >> 
> >> Thanks!
> >> 
> >> --
> >> Alexander Kurakin
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re[4]: Newlib cross-compiling issue
  2017-01-04 20:31     ` Jeff Johnston
@ 2017-01-04 21:29       ` Alexander Kurakin via newlib
  2017-01-04 22:05         ` Jeff Johnston
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Kurakin via newlib @ 2017-01-04 21:29 UTC (permalink / raw)
  To: newlib

Thanks, it works!

It would be great to have this info in --help.


-- 
Alexander Kurakin

>Среда,  4 января 2017, 23:31 +03:00 от Jeff Johnston <jjohnstn@redhat.com>:
>
>Hi Alexander,
>
>Newlib doesn't process the --with-cpu, --with-fpu, --with-float, and --with-mode
>options in its configure.
>
>To add specific newlib target options, you can do so when invoking make:
>
>make all-target-newlib CFLAGS_FOR_TARGET="-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb ... 
>
>-- Jeff J.
>
>----- Original Message -----
>> Hi, Jeff! Thanks for reply!
>> 
>> Have looked now, but even with:
>> 
>> ./configure \
>>  --target=arm-none-eabi \
>>  --with-cpu=cortex-m4 \
>>  --with-fpu=fpv4-sp-d16 \
>>  --with-float=hard \
>>  --with-mode=thumb \
>> ...
>> 
>> I don't see something about cpu, arch, etc. in build log.
>> 
>> Typical call to compiler is:
>> arm-none-eabi-gcc -B./arm-none-eabi/newlib/ -isystem
>> ./arm-none-eabi/newlib/targ-include -isystem
>> /home/sasha/1/newlib-2.1.0/newlib/libc/include
>> -B./arm-none-eabi/libgloss/arm -L./arm-none-eabi/libgloss/libnosys
>> -L/home/sasha/1/newlib-2.1.0/libgloss/arm -DPACKAGE_NAME=\"newlib\"
>> -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"2.1.0\"
>> -DPACKAGE_STRING=\"newlib\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\"
>> -DPACKAGE_URL=\"\" -I.
>> -I../../../../../../newlib-2.1.0/newlib/libm/machine/arm -I
>> ../../../../../../newlib-2.1.0/newlib/libm/machine/arm/../../../../newlib/libm/common
>> -D__SINGLE_THREAD__ -D__NO_SYSCALLS__ -DNO_FLOATING_POINT -fno-builtin -g
>> -O2 -c -o lib_a-s_floor.o `test -f 's_floor.c' || echo
>> '../../../../../../newlib-2.1.0/newlib/libm/machine/arm/'`s_floor.c
>> 
>> Thanks!
>> 
>> 
>> --
>> Alexander Kurakin
>> 
>> >Пятница, 16 декабря 2016, 1:52 +03:00 от Jeff Johnston
>> >< jjohnstn@redhat.com >:
>> >
>> >Hi Alexander,
>> >
>> >Have you looked at:
>> > https://istarc.wordpress.com/2014/07/21/stm32f4-build-your-toolchain-from-scratch/
>> >?
>> >
>> >-- Jeff J.
>> >
>> >----- Original Message -----
>> >> Good day!
>> >> 
>> >> I'm trying to compile Newlib for STM32F4DISCOVERY. My system is Ubuntu
>> >> 14.04
>> >> x86_64, my toolchain is ARM GCC Embedded toolchain [1] (so compiler is
>> >> arm-none-eabi-gcc).
>> >> 
>> >> How do I configure and compile? Show me a command, please?
>> >> 
>> >> (Sure) I've done some actions but they are all unsuccessful. Most often
>> >> cases
>> >> (while playing with --target, --host, --build) are:
>> >> *  unrecognized target machine,
>> >> *  host compiler is used instead of target while "compiler checking" (and
>> >> it
>> >> doesn't recognize ARM-specific options),
>> >> *  (target compiler is used and) executable format error.
>> >> 
>> >> CFLAGS I add: -DPREFER_SIZE_OVER_SPEED -mfloat-abi=softfp -mcpu=cortex-m4
>> >> -mthumb
>> >> Switches I add: --disable-libquadmath --disable-libquadmath-support
>> >> --disable-libstdcxx --disable-newlib-fvwrite-in-streamio
>> >> --disable-newlib-fseek-optimization --disable-newlib-wide-orient
>> >> --disable-newlib-unbuf-stream-opt --disable-multilib
>> >> --disable-newlib-multithread --disable-newlib-io-float
>> >> --disable-newlib-supplied-syscalls
>> >> 
>> >> Thanks!
>> >> 
>> >> --
>> >> Alexander Kurakin
>> 
>> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re[4]: Newlib cross-compiling issue
  2017-01-04 21:29       ` Re[4]: " Alexander Kurakin via newlib
@ 2017-01-04 22:05         ` Jeff Johnston
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Johnston @ 2017-01-04 22:05 UTC (permalink / raw)
  To: Alexander Kurakin; +Cc: newlib

I don't believe --help is appropriate here (there is no configure command
line option we are using and the configure help is auto-generated from the command line options that
are supported).

I could create a note in the newlib FAQ though as this issue has come up before.

----- Original Message -----
> Thanks, it works!
> 
> It would be great to have this info in --help.
> 
> 
> --
> Alexander Kurakin
> 
> >Среда,  4 января 2017, 23:31 +03:00 от Jeff Johnston <jjohnstn@redhat.com>:
> >
> >Hi Alexander,
> >
> >Newlib doesn't process the --with-cpu, --with-fpu, --with-float, and
> >--with-mode
> >options in its configure.
> >
> >To add specific newlib target options, you can do so when invoking make:
> >
> >make all-target-newlib CFLAGS_FOR_TARGET="-mcpu=cortex-m4 -mfpu=fpv4-sp-d16
> >-mthumb ...
> >
> >-- Jeff J.
> >
> >----- Original Message -----
> >> Hi, Jeff! Thanks for reply!
> >> 
> >> Have looked now, but even with:
> >> 
> >> ./configure \
> >>  --target=arm-none-eabi \
> >>  --with-cpu=cortex-m4 \
> >>  --with-fpu=fpv4-sp-d16 \
> >>  --with-float=hard \
> >>  --with-mode=thumb \
> >> ...
> >> 
> >> I don't see something about cpu, arch, etc. in build log.
> >> 
> >> Typical call to compiler is:
> >> arm-none-eabi-gcc -B./arm-none-eabi/newlib/ -isystem
> >> ./arm-none-eabi/newlib/targ-include -isystem
> >> /home/sasha/1/newlib-2.1.0/newlib/libc/include
> >> -B./arm-none-eabi/libgloss/arm -L./arm-none-eabi/libgloss/libnosys
> >> -L/home/sasha/1/newlib-2.1.0/libgloss/arm -DPACKAGE_NAME=\"newlib\"
> >> -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"2.1.0\"
> >> -DPACKAGE_STRING=\"newlib\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\"
> >> -DPACKAGE_URL=\"\" -I.
> >> -I../../../../../../newlib-2.1.0/newlib/libm/machine/arm -I
> >> ../../../../../../newlib-2.1.0/newlib/libm/machine/arm/../../../../newlib/libm/common
> >> -D__SINGLE_THREAD__ -D__NO_SYSCALLS__ -DNO_FLOATING_POINT -fno-builtin -g
> >> -O2 -c -o lib_a-s_floor.o `test -f 's_floor.c' || echo
> >> '../../../../../../newlib-2.1.0/newlib/libm/machine/arm/'`s_floor.c
> >> 
> >> Thanks!
> >> 
> >> 
> >> --
> >> Alexander Kurakin
> >> 
> >> >Пятница, 16 декабря 2016, 1:52 +03:00 от Jeff Johnston
> >> >< jjohnstn@redhat.com >:
> >> >
> >> >Hi Alexander,
> >> >
> >> >Have you looked at:
> >> > https://istarc.wordpress.com/2014/07/21/stm32f4-build-your-toolchain-from-scratch/
> >> >?
> >> >
> >> >-- Jeff J.
> >> >
> >> >----- Original Message -----
> >> >> Good day!
> >> >> 
> >> >> I'm trying to compile Newlib for STM32F4DISCOVERY. My system is Ubuntu
> >> >> 14.04
> >> >> x86_64, my toolchain is ARM GCC Embedded toolchain [1] (so compiler is
> >> >> arm-none-eabi-gcc).
> >> >> 
> >> >> How do I configure and compile? Show me a command, please?
> >> >> 
> >> >> (Sure) I've done some actions but they are all unsuccessful. Most often
> >> >> cases
> >> >> (while playing with --target, --host, --build) are:
> >> >> *  unrecognized target machine,
> >> >> *  host compiler is used instead of target while "compiler checking"
> >> >> (and
> >> >> it
> >> >> doesn't recognize ARM-specific options),
> >> >> *  (target compiler is used and) executable format error.
> >> >> 
> >> >> CFLAGS I add: -DPREFER_SIZE_OVER_SPEED -mfloat-abi=softfp
> >> >> -mcpu=cortex-m4
> >> >> -mthumb
> >> >> Switches I add: --disable-libquadmath --disable-libquadmath-support
> >> >> --disable-libstdcxx --disable-newlib-fvwrite-in-streamio
> >> >> --disable-newlib-fseek-optimization --disable-newlib-wide-orient
> >> >> --disable-newlib-unbuf-stream-opt --disable-multilib
> >> >> --disable-newlib-multithread --disable-newlib-io-float
> >> >> --disable-newlib-supplied-syscalls
> >> >> 
> >> >> Thanks!
> >> >> 
> >> >> --
> >> >> Alexander Kurakin
> >> 
> >> 
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-04 22:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-11 21:12 Newlib cross-compiling issue Alexander Kurakin via newlib
     [not found] ` <221861229.4241353.1481842367211.JavaMail.zimbra@redhat.com>
2016-12-18 11:36   ` Re[2]: " Alexander Kurakin via newlib
2016-12-19 11:12     ` Freddie Chopin
2017-01-04 20:31     ` Jeff Johnston
2017-01-04 21:29       ` Re[4]: " Alexander Kurakin via newlib
2017-01-04 22:05         ` Jeff Johnston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).