public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* Newlib-3.3.0 build failed with gcc-9.3.0 armv6-m
@ 2020-03-21 17:45 bitmap kid
  2020-03-23 11:39 ` Emmanuel Blot
  2020-03-25 18:02 ` Richard Earnshaw (lists)
  0 siblings, 2 replies; 4+ messages in thread
From: bitmap kid @ 2020-03-21 17:45 UTC (permalink / raw)
  To: newlib

Hello,

When I compile newlib with a gcc-9.3.0, i get the following error :

arm-unknown-eabi-gcc
-B/home/th/Downloads/newlib-3.3.0-build/arm-unknown-eabi/newlib/ -isystem
/home/th/Downloads/newlib-3.3.0-build/arm-unknown-eabi/newlib/targ-include
-isystem /home/th/Downloads/newlib-3.3.0/newlib/libc/include
-B/home/th/Downloads/newlib-3.3.0-build/arm-unknown-eabi/libgloss/arm
-L/home/th/Downloads/newlib-3.3.0-build/arm-unknown-eabi/libgloss/libnosys
-L/home/th/Downloads/newlib-3.3.0/libgloss/arm    -g -O2 -I.
-I../../../../newlib-3.3.0/libgloss/arm/.. `if [ -d ./../../newlib ]; then
echo -I../../../../newlib-3.3.0/libgloss/arm/../../newlib/libc/machine/arm;
fi` -g -O2 -c ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S
../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S: Assembler messages:
../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:44: Error: SVC is
not permitted on this architecture
../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:45: Error: SVC is
not permitted on this architecture
../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:46: Error: SVC is
not permitted on this architecture
[...]
../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:102: Error: SVC is
not permitted on this architecture
../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:103: Error: SVC is
not permitted on this architecture
make[3]: *** [Makefile:126 : linux-syscalls0.o] Erreur 1

Not really surprising, because this GCC is armv6-m default arch, an
unavailable coprocessor instructions cpu.

Am I at an impasse ?

Below, the newlib configure command :

../newlib-3.3.0/configure --prefix=/home/th/armv4vm-cc/
 --disable-interwork --disable-newlib-supplied-syscalls --with-gnu-ld
--with-gnu-as --disable-shared --disable-nls  --enable-newlib-io-long-long
--enable-newlib-io-long-double  --enable-newlib-io-c99-formats
--target=arm-unknown-eabi

I I will not hide from you that I have not checked if this version of gcc
is compatible with this one from newlib :(

I thank you so much to help me to find a work around.

thierry

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

* Re: Newlib-3.3.0 build failed with gcc-9.3.0 armv6-m
  2020-03-21 17:45 Newlib-3.3.0 build failed with gcc-9.3.0 armv6-m bitmap kid
@ 2020-03-23 11:39 ` Emmanuel Blot
  2020-03-25 18:02 ` Richard Earnshaw (lists)
  1 sibling, 0 replies; 4+ messages in thread
From: Emmanuel Blot @ 2020-03-23 11:39 UTC (permalink / raw)
  To: bitmap kid; +Cc: newlib



On 21 Mar 2020, at 18:45, bitmap kid via Newlib wrote:

> Hello,
>
> When I compile newlib with a gcc-9.3.0, i get the following error :

> arm-unknown-eabi-gcc
> ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:103: Error: 
> SVC is
> not permitted on this architecture
> make[3]: *** [Makefile:126 : linux-syscalls0.o] Erreur 1

I’ve bumped on this one so many times :-)
I do not get why the build system tries to build Linux syscalls for a 
baremetal target, hence the error.

> Am I at an impasse ?

Not really. If there is no better way, you can apply a small patch to 
disable building those files.
See for example the patch files from 
https://github.com/eblot/homebrew-armeabi/blob/master/armv6m-cortex-m0plus.rb, 
I’d day the one you want to have a look at is 
https://gist.githubusercontent.com/eblot/2f0af31b27cf3d6300b190906ae58c5c/raw/de43bc16b7280c97467af09ef329fc527296226e/newlib-arm-eabi-3.1.0.patch/

HTH,
Manu

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

* Re: Newlib-3.3.0 build failed with gcc-9.3.0 armv6-m
  2020-03-21 17:45 Newlib-3.3.0 build failed with gcc-9.3.0 armv6-m bitmap kid
  2020-03-23 11:39 ` Emmanuel Blot
@ 2020-03-25 18:02 ` Richard Earnshaw (lists)
  2020-03-26 18:07   ` bitmap kid
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Earnshaw (lists) @ 2020-03-25 18:02 UTC (permalink / raw)
  To: bitmap kid, newlib

On 21/03/2020 17:45, bitmap kid via Newlib wrote:
> Hello,
> 
> When I compile newlib with a gcc-9.3.0, i get the following error :
> 
> arm-unknown-eabi-gcc
> -B/home/th/Downloads/newlib-3.3.0-build/arm-unknown-eabi/newlib/ -isystem
> /home/th/Downloads/newlib-3.3.0-build/arm-unknown-eabi/newlib/targ-include
> -isystem /home/th/Downloads/newlib-3.3.0/newlib/libc/include
> -B/home/th/Downloads/newlib-3.3.0-build/arm-unknown-eabi/libgloss/arm
> -L/home/th/Downloads/newlib-3.3.0-build/arm-unknown-eabi/libgloss/libnosys
> -L/home/th/Downloads/newlib-3.3.0/libgloss/arm    -g -O2 -I.
> -I../../../../newlib-3.3.0/libgloss/arm/.. `if [ -d ./../../newlib ]; then
> echo -I../../../../newlib-3.3.0/libgloss/arm/../../newlib/libc/machine/arm;
> fi` -g -O2 -c ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S
> ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S: Assembler messages:
> ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:44: Error: SVC is
> not permitted on this architecture
> ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:45: Error: SVC is
> not permitted on this architecture
> ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:46: Error: SVC is
> not permitted on this architecture
> [...]
> ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:102: Error: SVC is
> not permitted on this architecture
> ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:103: Error: SVC is
> not permitted on this architecture
> make[3]: *** [Makefile:126 : linux-syscalls0.o] Erreur 1
> 
> Not really surprising, because this GCC is armv6-m default arch, an
> unavailable coprocessor instructions cpu.
> 
> Am I at an impasse ?
> 
> Below, the newlib configure command :
> 
> ../newlib-3.3.0/configure --prefix=/home/th/armv4vm-cc/
>   --disable-interwork --disable-newlib-supplied-syscalls --with-gnu-ld
> --with-gnu-as --disable-shared --disable-nls  --enable-newlib-io-long-long
> --enable-newlib-io-long-double  --enable-newlib-io-c99-formats
> --target=arm-unknown-eabi
> 
> I I will not hide from you that I have not checked if this version of gcc
> is compatible with this one from newlib :(
> 
> I thank you so much to help me to find a work around.
> 
> thierry
> 

SVC is supported by armv6s-m, which is a minor variant of the 
architecture.  You can use that if you want.

TLDR: the only difference between armv6-m and armv6s-m is how the SVC 
opcode is handled by the hardware.  In armv6s-m there is a specific 
exception mode to handle it.  In armv6-m this exception mode is lacking 
and the instruction will take the undefined instruction exception (which 
can then emulate the instruction if it so desires).  Either can 
therefore support SVC and the only difference is for 'kernel' code that 
has to understand the different behaviours.  There's a small performance 
cost as well, of course, because the instruction has to be decoded first 
if going via the undef instruction trap.

R.

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

* Re: Newlib-3.3.0 build failed with gcc-9.3.0 armv6-m
  2020-03-25 18:02 ` Richard Earnshaw (lists)
@ 2020-03-26 18:07   ` bitmap kid
  0 siblings, 0 replies; 4+ messages in thread
From: bitmap kid @ 2020-03-26 18:07 UTC (permalink / raw)
  To: Richard Earnshaw (lists); +Cc: newlib, eblot.ml

Thank you both for the advice and details.

Laboriously, I arrived at a solution which suits me. Precede the call to
./configure by setting the flag CFLAGS_FOR_TARGET with the following values:

CFLAGS_FOR_TARGET='- mcpu=arm7tdmi -marm -mlittle-endian -mfloat-abi=soft
-O0' ../newlib-3.3.0/configure --prefix = ... etc.

That does the job. Thank you again.

Le mer. 25 mars 2020 à 19:02, Richard Earnshaw (lists) <
Richard.Earnshaw@arm.com> a écrit :

> On 21/03/2020 17:45, bitmap kid via Newlib wrote:
> > Hello,
> >
> > When I compile newlib with a gcc-9.3.0, i get the following error :
> >
> > arm-unknown-eabi-gcc
> > -B/home/th/Downloads/newlib-3.3.0-build/arm-unknown-eabi/newlib/ -isystem
> >
> /home/th/Downloads/newlib-3.3.0-build/arm-unknown-eabi/newlib/targ-include
> > -isystem /home/th/Downloads/newlib-3.3.0/newlib/libc/include
> > -B/home/th/Downloads/newlib-3.3.0-build/arm-unknown-eabi/libgloss/arm
> >
> -L/home/th/Downloads/newlib-3.3.0-build/arm-unknown-eabi/libgloss/libnosys
> > -L/home/th/Downloads/newlib-3.3.0/libgloss/arm    -g -O2 -I.
> > -I../../../../newlib-3.3.0/libgloss/arm/.. `if [ -d ./../../newlib ];
> then
> > echo
> -I../../../../newlib-3.3.0/libgloss/arm/../../newlib/libc/machine/arm;
> > fi` -g -O2 -c ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S
> > ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S: Assembler
> messages:
> > ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:44: Error: SVC is
> > not permitted on this architecture
> > ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:45: Error: SVC is
> > not permitted on this architecture
> > ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:46: Error: SVC is
> > not permitted on this architecture
> > [...]
> > ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:102: Error: SVC
> is
> > not permitted on this architecture
> > ../../../../newlib-3.3.0/libgloss/arm/linux-syscalls0.S:103: Error: SVC
> is
> > not permitted on this architecture
> > make[3]: *** [Makefile:126 : linux-syscalls0.o] Erreur 1
> >
> > Not really surprising, because this GCC is armv6-m default arch, an
> > unavailable coprocessor instructions cpu.
> >
> > Am I at an impasse ?
> >
> > Below, the newlib configure command :
> >
> > ../newlib-3.3.0/configure --prefix=/home/th/armv4vm-cc/
> >   --disable-interwork --disable-newlib-supplied-syscalls --with-gnu-ld
> > --with-gnu-as --disable-shared --disable-nls
> --enable-newlib-io-long-long
> > --enable-newlib-io-long-double  --enable-newlib-io-c99-formats
> > --target=arm-unknown-eabi
> >
> > I I will not hide from you that I have not checked if this version of gcc
> > is compatible with this one from newlib :(
> >
> > I thank you so much to help me to find a work around.
> >
> > thierry
> >
>
> SVC is supported by armv6s-m, which is a minor variant of the
> architecture.  You can use that if you want.
>
> TLDR: the only difference between armv6-m and armv6s-m is how the SVC
> opcode is handled by the hardware.  In armv6s-m there is a specific
> exception mode to handle it.  In armv6-m this exception mode is lacking
> and the instruction will take the undefined instruction exception (which
> can then emulate the instruction if it so desires).  Either can
> therefore support SVC and the only difference is for 'kernel' code that
> has to understand the different behaviours.  There's a small performance
> cost as well, of course, because the instruction has to be decoded first
> if going via the undef instruction trap.
>
> R.
>

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

end of thread, other threads:[~2020-03-26 18:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-21 17:45 Newlib-3.3.0 build failed with gcc-9.3.0 armv6-m bitmap kid
2020-03-23 11:39 ` Emmanuel Blot
2020-03-25 18:02 ` Richard Earnshaw (lists)
2020-03-26 18:07   ` bitmap kid

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).