public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] arc: Support "nano" build of newlib
@ 2016-04-29 15:29 Anton Kolesov
  2016-04-29 15:29 ` [PATCH 2/3] arc: Use new definitions for optional ARC CPU features in libgloss Anton Kolesov
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Anton Kolesov @ 2016-04-29 15:29 UTC (permalink / raw)
  To: newlib; +Cc: Francois.Bedard, Anton Kolesov

Add necessary infrastructure to support "nano" build of newlib - optimized
for code size. ARC aproach to this feature is similiar to ARM's one here.

libgloss/Changelog:

2016-04-29  Anton Kolesov  <anton.kolesov@synopsys.com>

	* arc/nano.specs: New file.
	* arc/Makefile.in: Support nano.specs.
	* arc/nsim.specs: Likewise.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
---
 libgloss/arc/Makefile.in | 10 +++++++++-
 libgloss/arc/nano.specs  | 18 ++++++++++++++++++
 libgloss/arc/nsim.specs  | 10 ++++++++--
 3 files changed, 35 insertions(+), 3 deletions(-)
 create mode 100644 libgloss/arc/nano.specs

diff --git a/libgloss/arc/Makefile.in b/libgloss/arc/Makefile.in
index ab8ad6d..58f0c57 100644
--- a/libgloss/arc/Makefile.in
+++ b/libgloss/arc/Makefile.in
@@ -58,6 +58,9 @@ NSIM_OBJS = \
 NSIM_INSTALL = install-nsim
 NSIM_SCRIPTS = nsim.specs
 
+NANO_SCRIPTS = nano.specs
+NANO_INSTALL = install-nano
+
 CFLAGS		= -g
 
 # Host specific makefile fragment comes in here.
@@ -83,7 +86,7 @@ distclean maintainer-clean realclean: clean
 	rm -f Makefile config.status config.log config.cache *~
 
 .PHONY: install info install-info clean-info doc dvi
-install: $(CRT0_INSTALL) $(NSIM_INSTALL)
+install: $(CRT0_INSTALL) $(NSIM_INSTALL) $(NANO_INSTALL)
 
 # multilibdir may not exist yet - libgcc for ARC depends on libc, hence
 # newlib/libgloss is built before libgcc. And in parallel build libgloss maybe
@@ -100,6 +103,11 @@ $(NSIM_INSTALL):
 	for x in $(NSIM_SCRIPTS); do \
 	    $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$$x; done
 
+$(NANO_INSTALL):
+	$(mkinstalldirs) $(DESTDIR)${tooldir}/lib${MULTISUBDIR}
+	for x in $(NANO_SCRIPTS); do \
+	    $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$$x; done
+
 doc:
 info:
 dvi:
diff --git a/libgloss/arc/nano.specs b/libgloss/arc/nano.specs
new file mode 100644
index 0000000..91ab61d
--- /dev/null
+++ b/libgloss/arc/nano.specs
@@ -0,0 +1,18 @@
+%rename link                nano_link
+%rename link_gcc_c_sequence                nano_link_gcc_c_sequence
+
+*nano_libc:
+-lc_nano
+
+*nano_libgloss:
+%{specs=nsim.specs:-lnsim} %{specs=nosys.specs:-lnosys}
+
+*link_gcc_c_sequence:
+%(nano_link_gcc_c_sequence) --start-group %G %(nano_libc) %(nano_libgloss) --end-group
+
+*link:
+%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano) %:replace-outfile(-lstdc++ -lstdc++_nano) %:replace-outfile(-lsupc++ -lsupc++_nano)
+
+*lib:
+%{!shared:%{g*:-lg_nano} %{!p:%{!pg:-lc_nano}}%{p:-lc_p}%{pg:-lc_p}}
+
diff --git a/libgloss/arc/nsim.specs b/libgloss/arc/nsim.specs
index aa77eea..508bdb2 100644
--- a/libgloss/arc/nsim.specs
+++ b/libgloss/arc/nsim.specs
@@ -1,5 +1,11 @@
-%rename link_gcc_c_sequence                nsim_link_gcc_c_sequence
+%rename link_gcc_c_sequence nsim_link_gcc_c_sequence
+
+*nsim_libgloss:
+-lnsim
+
+*nsim_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
 
 *link_gcc_c_sequence:
-%(nsim_link_gcc_c_sequence) --start-group %G -lc -lnsim --end-group
+%(nsim_link_gcc_c_sequence) --start-group %G %(nsim_libc) %(nsim_libgloss) --end-group
 
-- 
2.8.1

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

* [PATCH 2/3] arc: Use new definitions for optional ARC CPU features in libgloss
  2016-04-29 15:29 [PATCH 1/3] arc: Support "nano" build of newlib Anton Kolesov
@ 2016-04-29 15:29 ` Anton Kolesov
  2016-05-02 16:00   ` Jeff Johnston
  2016-04-29 15:29 ` [PATCH 3/3] arc: Fix crt0.S for cores without barrel shifter Anton Kolesov
  2016-04-29 19:18 ` [PATCH 1/3] arc: Support "nano" build of newlib Jeff Johnston
  2 siblings, 1 reply; 12+ messages in thread
From: Anton Kolesov @ 2016-04-29 15:29 UTC (permalink / raw)
  To: newlib; +Cc: Francois.Bedard, Anton Kolesov

This is similar to commit 06537f05d4b6a0d2db01c6afda1d2a0ea2588126 to the
newlib for ARC.

GCC for ARC has been updated to provide consistent naming of preprocessor
definitions for different optional architecture features:

    * __ARC_BARREL_SHIFTER__ instead of __Xbarrel_shifter for
      -mbarrel-shifter
    * __ARCEM__ instead of __EM__ for ARC EM cores
    * __ARCHS__ instead of __HS__ for ARC HS cores
    * etc (not used in libgloss)

This patch updates crt0.S for ARC to use new definitions instead of a
deprecated ones. To ensure compatibility with older compiler new definitions
are also defined in crt0.S if needed, based on presence of deprecated
preprocessor definitions.

libgloss/ChangeLog

2016-04-29  Anton Kolesov  <Anton.Kolesov@synopsys.com>

	* arc/crt0.S: Use new GCC defines to detect processor features.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
---
 libgloss/arc/crt0.S | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/libgloss/arc/crt0.S b/libgloss/arc/crt0.S
index e4a15eb..fdcdefa 100644
--- a/libgloss/arc/crt0.S
+++ b/libgloss/arc/crt0.S
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2015, Synopsys, Inc. All rights reserved.
+   Copyright (c) 2015-2016, Synopsys, Inc. All rights reserved.
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:
@@ -41,10 +41,25 @@
    the initialization code.
 */
 
+/* Compatibility with older ARC GCC, that doesn't provide some of the
+   preprocessor defines used by newlib and libgloss for ARC.  */
+#if defined (__Xbarrel_shifter) && !defined (__ARC_BARREL_SHIFTER__)
+#define __ARC_BARREL_SHIFTER__ 1
+#endif
+
+#if defined (__EM__) && !defined (__ARCEM__)
+#define __ARCEM__ 1
+#endif
+
+#if defined (__HS__) && !defined (__ARCHS__)
+#define __ARCHS__ 1
+#endif
+
+
 	.file	"crt0.S"
 	.extern main
 
-#if defined (__EM__) || defined (__HS__)
+#if defined (__ARCEM__) || defined (__ARCHS__)
 	.section .ivt, "a", @progbits
 
 ; handler's name,          type,    number,name,   offset in IVT (hex/dec)
@@ -74,7 +89,7 @@
 	.section .text.__startup, "ax", @progbits
 #else
 	.text
-#endif
+#endif /* __ARCEM__ || __ARCHS__ */
 
 	.global	__start
 	.type	__start, @function
@@ -111,7 +126,7 @@ __start:
 ;   instruction
 ; - loop body should have at least two instruction words
 __start:
-#if defined (__HS__)
+#if defined (__ARCHS__)
 	; Allow unaligned accesses.
 	lr	r2, [0xA]
 	bset	r2, r2, 19
@@ -159,25 +174,25 @@ __start:
 	mov_s	r0, 1
 	st_s	r0, [r1, 4]		; _GLOBAL_REENT->atexit0._ind
 ; branch to _init
-#if defined (__EM__) || defined (__HS__)
+#if defined (__ARCEM__) || defined (__ARCHS__)
 	jl	@_init
 #else
 	bl	@_init
-#endif
+#endif /* __ARCEM__ || __ARCHS__ */
 	mov_s	r0, r13
 	mov_s	r1, r14
 ; branch to main
-#if defined (__EM__) || defined (__HS__)
+#if defined (__ARCEM__) || defined (__ARCHS__)
 	mov	fp,0			; initialize frame pointer
 	jl	@main
 #else
 	bl.d	@main
 	mov	fp, 0			; initialize frame pointer
-#endif
+#endif /* __ARCEM__ || __ARCHS__ */
 	; r0 contains exit code
 	j	@exit
 
-#if defined (__EM__) || defined (__HS__)
+#if defined (__ARCEM__) || defined (__ARCHS__)
 ; ARCv2 default interrupt routines, defined as weak symbols.
 ; Default implementation halts the core.  To conserve code size those symbols
 ; share a single implementation, however as a downside debugger and
@@ -225,7 +240,7 @@ IRQ_20              :
 	nop
 	b	.Lloop_halt
 	nop
-#endif
+#endif /* __ARCEM__ || __ARCHS__ */
 
 	.section .text._exit_halt,"ax",@progbits
 	.global	 _exit_halt
-- 
2.8.1

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

* [PATCH 3/3] arc: Fix crt0.S for cores without barrel shifter
  2016-04-29 15:29 [PATCH 1/3] arc: Support "nano" build of newlib Anton Kolesov
  2016-04-29 15:29 ` [PATCH 2/3] arc: Use new definitions for optional ARC CPU features in libgloss Anton Kolesov
@ 2016-04-29 15:29 ` Anton Kolesov
  2016-05-02 16:06   ` Jeff Johnston
  2016-04-29 19:18 ` [PATCH 1/3] arc: Support "nano" build of newlib Jeff Johnston
  2 siblings, 1 reply; 12+ messages in thread
From: Anton Kolesov @ 2016-04-29 15:29 UTC (permalink / raw)
  To: newlib; +Cc: Francois.Bedard, Anton Kolesov

crt0.S for ARC used to use instruction "asr.f lp_count, r3, 2" for all cores
except ARC601. However instructions which shift more than 1 bit are
optional, so this crt0.S didn't worked for all ARC cores.

Luckily this is a shift just by 2 bits on all occassions, so fix is trivial
- use two single-bit shifts.

libgloss/ChangeLog

2016-04-29  Anton Kolesov  <anton.kolesov@synopsys.com>

	* arc/crt0.S: Fix support for processors without barrel-shifter.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
---
 libgloss/arc/crt0.S | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libgloss/arc/crt0.S b/libgloss/arc/crt0.S
index fdcdefa..3b80184 100644
--- a/libgloss/arc/crt0.S
+++ b/libgloss/arc/crt0.S
@@ -136,7 +136,12 @@ __start:
 	mov_s	r2, @__sbss_start	; r2 = start of the bss section
 	sub	r3, @_end, r2		; r3 = size of the bss section in bytes
 	; set up the loop counter register to the size (in words) of the bss section
+#if defined (__ARC_BARREL_SHIFTER__)
 	asr.f	lp_count, r3, 2
+#else
+	asr_s	r13, r3
+	asr.f	lp_count, r13
+#endif
 #if defined (__ARC600__)
 	; loop to zero out the bss.  Enter loop only if lp_count != 0
 	lpnz	@.Lend_zbss
-- 
2.8.1

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

* Re: [PATCH 1/3] arc: Support "nano" build of newlib
  2016-04-29 15:29 [PATCH 1/3] arc: Support "nano" build of newlib Anton Kolesov
  2016-04-29 15:29 ` [PATCH 2/3] arc: Use new definitions for optional ARC CPU features in libgloss Anton Kolesov
  2016-04-29 15:29 ` [PATCH 3/3] arc: Fix crt0.S for cores without barrel shifter Anton Kolesov
@ 2016-04-29 19:18 ` Jeff Johnston
  2016-05-05 11:56   ` Anton Kolesov
  2 siblings, 1 reply; 12+ messages in thread
From: Jeff Johnston @ 2016-04-29 19:18 UTC (permalink / raw)
  To: Anton Kolesov; +Cc: newlib, Francois Bedard

Patch applied.

-- Jeff J.

----- Original Message -----
> Add necessary infrastructure to support "nano" build of newlib - optimized
> for code size. ARC aproach to this feature is similiar to ARM's one here.
> 
> libgloss/Changelog:
> 
> 2016-04-29  Anton Kolesov  <anton.kolesov@synopsys.com>
> 
> 	* arc/nano.specs: New file.
> 	* arc/Makefile.in: Support nano.specs.
> 	* arc/nsim.specs: Likewise.
> 
> Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
> ---
>  libgloss/arc/Makefile.in | 10 +++++++++-
>  libgloss/arc/nano.specs  | 18 ++++++++++++++++++
>  libgloss/arc/nsim.specs  | 10 ++++++++--
>  3 files changed, 35 insertions(+), 3 deletions(-)
>  create mode 100644 libgloss/arc/nano.specs
> 
> diff --git a/libgloss/arc/Makefile.in b/libgloss/arc/Makefile.in
> index ab8ad6d..58f0c57 100644
> --- a/libgloss/arc/Makefile.in
> +++ b/libgloss/arc/Makefile.in
> @@ -58,6 +58,9 @@ NSIM_OBJS = \
>  NSIM_INSTALL = install-nsim
>  NSIM_SCRIPTS = nsim.specs
>  
> +NANO_SCRIPTS = nano.specs
> +NANO_INSTALL = install-nano
> +
>  CFLAGS		= -g
>  
>  # Host specific makefile fragment comes in here.
> @@ -83,7 +86,7 @@ distclean maintainer-clean realclean: clean
>  	rm -f Makefile config.status config.log config.cache *~
>  
>  .PHONY: install info install-info clean-info doc dvi
> -install: $(CRT0_INSTALL) $(NSIM_INSTALL)
> +install: $(CRT0_INSTALL) $(NSIM_INSTALL) $(NANO_INSTALL)
>  
>  # multilibdir may not exist yet - libgcc for ARC depends on libc, hence
>  # newlib/libgloss is built before libgcc. And in parallel build libgloss
>  maybe
> @@ -100,6 +103,11 @@ $(NSIM_INSTALL):
>  	for x in $(NSIM_SCRIPTS); do \
>  	    $(INSTALL_DATA) $(srcdir)/$$x
>  	    $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$$x; done
>  
> +$(NANO_INSTALL):
> +	$(mkinstalldirs) $(DESTDIR)${tooldir}/lib${MULTISUBDIR}
> +	for x in $(NANO_SCRIPTS); do \
> +	    $(INSTALL_DATA) $(srcdir)/$$x
> $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$$x; done
> +
>  doc:
>  info:
>  dvi:
> diff --git a/libgloss/arc/nano.specs b/libgloss/arc/nano.specs
> new file mode 100644
> index 0000000..91ab61d
> --- /dev/null
> +++ b/libgloss/arc/nano.specs
> @@ -0,0 +1,18 @@
> +%rename link                nano_link
> +%rename link_gcc_c_sequence                nano_link_gcc_c_sequence
> +
> +*nano_libc:
> +-lc_nano
> +
> +*nano_libgloss:
> +%{specs=nsim.specs:-lnsim} %{specs=nosys.specs:-lnosys}
> +
> +*link_gcc_c_sequence:
> +%(nano_link_gcc_c_sequence) --start-group %G %(nano_libc) %(nano_libgloss)
> --end-group
> +
> +*link:
> +%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano)
> %:replace-outfile(-lstdc++ -lstdc++_nano) %:replace-outfile(-lsupc++
> -lsupc++_nano)
> +
> +*lib:
> +%{!shared:%{g*:-lg_nano} %{!p:%{!pg:-lc_nano}}%{p:-lc_p}%{pg:-lc_p}}
> +
> diff --git a/libgloss/arc/nsim.specs b/libgloss/arc/nsim.specs
> index aa77eea..508bdb2 100644
> --- a/libgloss/arc/nsim.specs
> +++ b/libgloss/arc/nsim.specs
> @@ -1,5 +1,11 @@
> -%rename link_gcc_c_sequence                nsim_link_gcc_c_sequence
> +%rename link_gcc_c_sequence nsim_link_gcc_c_sequence
> +
> +*nsim_libgloss:
> +-lnsim
> +
> +*nsim_libc:
> +%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
>  
>  *link_gcc_c_sequence:
> -%(nsim_link_gcc_c_sequence) --start-group %G -lc -lnsim --end-group
> +%(nsim_link_gcc_c_sequence) --start-group %G %(nsim_libc) %(nsim_libgloss)
> --end-group
>  
> --
> 2.8.1
> 
> 

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

* Re: [PATCH 2/3] arc: Use new definitions for optional ARC CPU features in libgloss
  2016-04-29 15:29 ` [PATCH 2/3] arc: Use new definitions for optional ARC CPU features in libgloss Anton Kolesov
@ 2016-05-02 16:00   ` Jeff Johnston
  0 siblings, 0 replies; 12+ messages in thread
From: Jeff Johnston @ 2016-05-02 16:00 UTC (permalink / raw)
  To: Anton Kolesov; +Cc: newlib, Francois Bedard

Patch committed.

-- Jeff J.

----- Original Message -----
> This is similar to commit 06537f05d4b6a0d2db01c6afda1d2a0ea2588126 to the
> newlib for ARC.
> 
> GCC for ARC has been updated to provide consistent naming of preprocessor
> definitions for different optional architecture features:
> 
>     * __ARC_BARREL_SHIFTER__ instead of __Xbarrel_shifter for
>       -mbarrel-shifter
>     * __ARCEM__ instead of __EM__ for ARC EM cores
>     * __ARCHS__ instead of __HS__ for ARC HS cores
>     * etc (not used in libgloss)
> 
> This patch updates crt0.S for ARC to use new definitions instead of a
> deprecated ones. To ensure compatibility with older compiler new definitions
> are also defined in crt0.S if needed, based on presence of deprecated
> preprocessor definitions.
> 
> libgloss/ChangeLog
> 
> 2016-04-29  Anton Kolesov  <Anton.Kolesov@synopsys.com>
> 
> 	* arc/crt0.S: Use new GCC defines to detect processor features.
> 
> Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
> ---
>  libgloss/arc/crt0.S | 35 +++++++++++++++++++++++++----------
>  1 file changed, 25 insertions(+), 10 deletions(-)
> 
> diff --git a/libgloss/arc/crt0.S b/libgloss/arc/crt0.S
> index e4a15eb..fdcdefa 100644
> --- a/libgloss/arc/crt0.S
> +++ b/libgloss/arc/crt0.S
> @@ -1,5 +1,5 @@
>  /*
> -   Copyright (c) 2015, Synopsys, Inc. All rights reserved.
> +   Copyright (c) 2015-2016, Synopsys, Inc. All rights reserved.
>  
>     Redistribution and use in source and binary forms, with or without
>     modification, are permitted provided that the following conditions are
>     met:
> @@ -41,10 +41,25 @@
>     the initialization code.
>  */
>  
> +/* Compatibility with older ARC GCC, that doesn't provide some of the
> +   preprocessor defines used by newlib and libgloss for ARC.  */
> +#if defined (__Xbarrel_shifter) && !defined (__ARC_BARREL_SHIFTER__)
> +#define __ARC_BARREL_SHIFTER__ 1
> +#endif
> +
> +#if defined (__EM__) && !defined (__ARCEM__)
> +#define __ARCEM__ 1
> +#endif
> +
> +#if defined (__HS__) && !defined (__ARCHS__)
> +#define __ARCHS__ 1
> +#endif
> +
> +
>  	.file	"crt0.S"
>  	.extern main
>  
> -#if defined (__EM__) || defined (__HS__)
> +#if defined (__ARCEM__) || defined (__ARCHS__)
>  	.section .ivt, "a", @progbits
>  
>  ; handler's name,          type,    number,name,   offset in IVT (hex/dec)
> @@ -74,7 +89,7 @@
>  	.section .text.__startup, "ax", @progbits
>  #else
>  	.text
> -#endif
> +#endif /* __ARCEM__ || __ARCHS__ */
>  
>  	.global	__start
>  	.type	__start, @function
> @@ -111,7 +126,7 @@ __start:
>  ;   instruction
>  ; - loop body should have at least two instruction words
>  __start:
> -#if defined (__HS__)
> +#if defined (__ARCHS__)
>  	; Allow unaligned accesses.
>  	lr	r2, [0xA]
>  	bset	r2, r2, 19
> @@ -159,25 +174,25 @@ __start:
>  	mov_s	r0, 1
>  	st_s	r0, [r1, 4]		; _GLOBAL_REENT->atexit0._ind
>  ; branch to _init
> -#if defined (__EM__) || defined (__HS__)
> +#if defined (__ARCEM__) || defined (__ARCHS__)
>  	jl	@_init
>  #else
>  	bl	@_init
> -#endif
> +#endif /* __ARCEM__ || __ARCHS__ */
>  	mov_s	r0, r13
>  	mov_s	r1, r14
>  ; branch to main
> -#if defined (__EM__) || defined (__HS__)
> +#if defined (__ARCEM__) || defined (__ARCHS__)
>  	mov	fp,0			; initialize frame pointer
>  	jl	@main
>  #else
>  	bl.d	@main
>  	mov	fp, 0			; initialize frame pointer
> -#endif
> +#endif /* __ARCEM__ || __ARCHS__ */
>  	; r0 contains exit code
>  	j	@exit
>  
> -#if defined (__EM__) || defined (__HS__)
> +#if defined (__ARCEM__) || defined (__ARCHS__)
>  ; ARCv2 default interrupt routines, defined as weak symbols.
>  ; Default implementation halts the core.  To conserve code size those
>  symbols
>  ; share a single implementation, however as a downside debugger and
> @@ -225,7 +240,7 @@ IRQ_20              :
>  	nop
>  	b	.Lloop_halt
>  	nop
> -#endif
> +#endif /* __ARCEM__ || __ARCHS__ */
>  
>  	.section .text._exit_halt,"ax",@progbits
>  	.global	 _exit_halt
> --
> 2.8.1
> 
> 

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

* Re: [PATCH 3/3] arc: Fix crt0.S for cores without barrel shifter
  2016-04-29 15:29 ` [PATCH 3/3] arc: Fix crt0.S for cores without barrel shifter Anton Kolesov
@ 2016-05-02 16:06   ` Jeff Johnston
  0 siblings, 0 replies; 12+ messages in thread
From: Jeff Johnston @ 2016-05-02 16:06 UTC (permalink / raw)
  To: Anton Kolesov; +Cc: newlib, Francois Bedard

Patch committed.

-- Jeff J.

----- Original Message -----
> crt0.S for ARC used to use instruction "asr.f lp_count, r3, 2" for all cores
> except ARC601. However instructions which shift more than 1 bit are
> optional, so this crt0.S didn't worked for all ARC cores.
> 
> Luckily this is a shift just by 2 bits on all occassions, so fix is trivial
> - use two single-bit shifts.
> 
> libgloss/ChangeLog
> 
> 2016-04-29  Anton Kolesov  <anton.kolesov@synopsys.com>
> 
> 	* arc/crt0.S: Fix support for processors without barrel-shifter.
> 
> Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
> ---
>  libgloss/arc/crt0.S | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libgloss/arc/crt0.S b/libgloss/arc/crt0.S
> index fdcdefa..3b80184 100644
> --- a/libgloss/arc/crt0.S
> +++ b/libgloss/arc/crt0.S
> @@ -136,7 +136,12 @@ __start:
>  	mov_s	r2, @__sbss_start	; r2 = start of the bss section
>  	sub	r3, @_end, r2		; r3 = size of the bss section in bytes
>  	; set up the loop counter register to the size (in words) of the bss
>  	section
> +#if defined (__ARC_BARREL_SHIFTER__)
>  	asr.f	lp_count, r3, 2
> +#else
> +	asr_s	r13, r3
> +	asr.f	lp_count, r13
> +#endif
>  #if defined (__ARC600__)
>  	; loop to zero out the bss.  Enter loop only if lp_count != 0
>  	lpnz	@.Lend_zbss
> --
> 2.8.1
> 
> 

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

* RE: [PATCH 1/3] arc: Support "nano" build of newlib
  2016-04-29 19:18 ` [PATCH 1/3] arc: Support "nano" build of newlib Jeff Johnston
@ 2016-05-05 11:56   ` Anton Kolesov
  2016-05-05 16:03     ` Jeff Johnston
  0 siblings, 1 reply; 12+ messages in thread
From: Anton Kolesov @ 2016-05-05 11:56 UTC (permalink / raw)
  To: Jeff Johnston; +Cc: newlib, Francois Bedard

Hi Jeff,

> >
> > +$(NANO_INSTALL):
> > +	$(mkinstalldirs) $(DESTDIR)${tooldir}/lib${MULTISUBDIR}
> > +	for x in $(NANO_SCRIPTS); do \
> > +	    $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$$x; done
> > +

Unfortunately, tabs in Makefile.in got replaced with spaces, when patch was applied - so now Make complains about syntax errors in libgloss/arc/Makefile.

Anton


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

* Re: [PATCH 1/3] arc: Support "nano" build of newlib
  2016-05-05 11:56   ` Anton Kolesov
@ 2016-05-05 16:03     ` Jeff Johnston
  2016-05-06 19:38       ` Anton Kolesov
  0 siblings, 1 reply; 12+ messages in thread
From: Jeff Johnston @ 2016-05-05 16:03 UTC (permalink / raw)
  To: Anton Kolesov; +Cc: newlib, Francois Bedard

Fixed.

-- Jeff J.

----- Original Message -----
> Hi Jeff,
> 
> > >
> > > +$(NANO_INSTALL):
> > > +	$(mkinstalldirs) $(DESTDIR)${tooldir}/lib${MULTISUBDIR}
> > > +	for x in $(NANO_SCRIPTS); do \
> > > +	    $(INSTALL_DATA) $(srcdir)/$$x
> > > $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$$x; done
> > > +
> 
> Unfortunately, tabs in Makefile.in got replaced with spaces, when patch was
> applied - so now Make complains about syntax errors in
> libgloss/arc/Makefile.
> 
> Anton
> 
> 

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

* RE: [PATCH 1/3] arc: Support "nano" build of newlib
  2016-05-05 16:03     ` Jeff Johnston
@ 2016-05-06 19:38       ` Anton Kolesov
  2016-05-06 19:57         ` Jeff Johnston
  0 siblings, 1 reply; 12+ messages in thread
From: Anton Kolesov @ 2016-05-06 19:38 UTC (permalink / raw)
  To: Jeff Johnston; +Cc: newlib, Francois Bedard

[-- Attachment #1: Type: text/plain, Size: 998 bytes --]

Hi Jeff,

Thanks, but now I've also noticed that ":-l" disappeared from nano.specs.
Attaching the patch that corrects that.

Anton

> -----Original Message-----
> From: Jeff Johnston [mailto:jjohnstn@redhat.com]
> Sent: Thursday, May 05, 2016 7:03 PM
> To: Anton Kolesov <Anton.Kolesov@synopsys.com>
> Cc: newlib@sourceware.org; Francois Bedard <Francois.Bedard@synopsys.com>
> Subject: Re: [PATCH 1/3] arc: Support "nano" build of newlib
> 
> Fixed.
> 
> -- Jeff J.
> 
> ----- Original Message -----
> > Hi Jeff,
> >
> > > >
> > > > +$(NANO_INSTALL):
> > > > +	$(mkinstalldirs) $(DESTDIR)${tooldir}/lib${MULTISUBDIR}
> > > > +	for x in $(NANO_SCRIPTS); do \
> > > > +	    $(INSTALL_DATA) $(srcdir)/$$x
> > > > $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$$x; done
> > > > +
> >
> > Unfortunately, tabs in Makefile.in got replaced with spaces, when patch was
> > applied - so now Make complains about syntax errors in
> > libgloss/arc/Makefile.
> >
> > Anton
> >
> >

[-- Attachment #2: 0001-Fix-malformed-libgloss-arc-nano.specs.patch --]
[-- Type: application/octet-stream, Size: 1108 bytes --]

From 7ff5d6fade29818976fd37e20efda1a3152d61aa Mon Sep 17 00:00:00 2001
From: Anton Kolesov <Anton.Kolesov@synopsys.com>
Date: Fri, 6 May 2016 22:34:44 +0300
Subject: [PATCH] Fix malformed libgloss/arc/nano.specs

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
---
 libgloss/arc/nano.specs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libgloss/arc/nano.specs b/libgloss/arc/nano.specs
index dc9cbf3..91ab61d 100644
--- a/libgloss/arc/nano.specs
+++ b/libgloss/arc/nano.specs
@@ -5,7 +5,7 @@
 -lc_nano
 
 *nano_libgloss:
-%{specs=nsim.specsnsim} %{specs=nosys.specsnosys}
+%{specs=nsim.specs:-lnsim} %{specs=nosys.specs:-lnosys}
 
 *link_gcc_c_sequence:
 %(nano_link_gcc_c_sequence) --start-group %G %(nano_libc) %(nano_libgloss) --end-group
@@ -14,5 +14,5 @@
 %(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano) %:replace-outfile(-lstdc++ -lstdc++_nano) %:replace-outfile(-lsupc++ -lsupc++_nano)
 
 *lib:
-%{!shared:%{g*g_nano} %{!p:%{!pgc_nano}}%{pc_p}%{pgc_p}}
+%{!shared:%{g*:-lg_nano} %{!p:%{!pg:-lc_nano}}%{p:-lc_p}%{pg:-lc_p}}
 
-- 
2.8.1


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

* Re: [PATCH 1/3] arc: Support "nano" build of newlib
  2016-05-06 19:38       ` Anton Kolesov
@ 2016-05-06 19:57         ` Jeff Johnston
  2016-05-11 10:14           ` Anton Kolesov
  0 siblings, 1 reply; 12+ messages in thread
From: Jeff Johnston @ 2016-05-06 19:57 UTC (permalink / raw)
  To: Anton Kolesov; +Cc: newlib, Francois Bedard

Fixed.  I wish people would attach their patches as frequently asked on
this mailing list.

-- Jeff J.

----- Original Message -----
> Hi Jeff,
> 
> Thanks, but now I've also noticed that ":-l" disappeared from nano.specs.
> Attaching the patch that corrects that.
> 
> Anton
> 
> > -----Original Message-----
> > From: Jeff Johnston [mailto:jjohnstn@redhat.com]
> > Sent: Thursday, May 05, 2016 7:03 PM
> > To: Anton Kolesov <Anton.Kolesov@synopsys.com>
> > Cc: newlib@sourceware.org; Francois Bedard <Francois.Bedard@synopsys.com>
> > Subject: Re: [PATCH 1/3] arc: Support "nano" build of newlib
> > 
> > Fixed.
> > 
> > -- Jeff J.
> > 
> > ----- Original Message -----
> > > Hi Jeff,
> > >
> > > > >
> > > > > +$(NANO_INSTALL):
> > > > > +	$(mkinstalldirs) $(DESTDIR)${tooldir}/lib${MULTISUBDIR}
> > > > > +	for x in $(NANO_SCRIPTS); do \
> > > > > +	    $(INSTALL_DATA) $(srcdir)/$$x
> > > > > $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$$x; done
> > > > > +
> > >
> > > Unfortunately, tabs in Makefile.in got replaced with spaces, when patch
> > > was
> > > applied - so now Make complains about syntax errors in
> > > libgloss/arc/Makefile.
> > >
> > > Anton
> > >
> > >
> 

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

* RE: [PATCH 1/3] arc: Support "nano" build of newlib
  2016-05-06 19:57         ` Jeff Johnston
@ 2016-05-11 10:14           ` Anton Kolesov
  2016-05-11 16:47             ` Jeff Johnston
  0 siblings, 1 reply; 12+ messages in thread
From: Anton Kolesov @ 2016-05-11 10:14 UTC (permalink / raw)
  To: Jeff Johnston; +Cc: newlib, Francois Bedard

[-- Attachment #1: Type: text/plain, Size: 1714 bytes --]

One more fix of this problem, for libgloss/arc/nsim.specs, but this is the last one.

Anton

> -----Original Message-----
> From: Jeff Johnston [mailto:jjohnstn@redhat.com]
> Sent: Friday, May 06, 2016 10:58 PM
> To: Anton Kolesov <Anton.Kolesov@synopsys.com>
> Cc: newlib@sourceware.org; Francois Bedard <Francois.Bedard@synopsys.com>
> Subject: Re: [PATCH 1/3] arc: Support "nano" build of newlib
> 
> Fixed.  I wish people would attach their patches as frequently asked on
> this mailing list.
> 
> -- Jeff J.
> 
> ----- Original Message -----
> > Hi Jeff,
> >
> > Thanks, but now I've also noticed that ":-l" disappeared from nano.specs.
> > Attaching the patch that corrects that.
> >
> > Anton
> >
> > > -----Original Message-----
> > > From: Jeff Johnston [mailto:jjohnstn@redhat.com]
> > > Sent: Thursday, May 05, 2016 7:03 PM
> > > To: Anton Kolesov <Anton.Kolesov@synopsys.com>
> > > Cc: newlib@sourceware.org; Francois Bedard <Francois.Bedard@synopsys.com>
> > > Subject: Re: [PATCH 1/3] arc: Support "nano" build of newlib
> > >
> > > Fixed.
> > >
> > > -- Jeff J.
> > >
> > > ----- Original Message -----
> > > > Hi Jeff,
> > > >
> > > > > >
> > > > > > +$(NANO_INSTALL):
> > > > > > +	$(mkinstalldirs) $(DESTDIR)${tooldir}/lib${MULTISUBDIR}
> > > > > > +	for x in $(NANO_SCRIPTS); do \
> > > > > > +	    $(INSTALL_DATA) $(srcdir)/$$x
> > > > > > $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$$x; done
> > > > > > +
> > > >
> > > > Unfortunately, tabs in Makefile.in got replaced with spaces, when patch
> > > > was
> > > > applied - so now Make complains about syntax errors in
> > > > libgloss/arc/Makefile.
> > > >
> > > > Anton
> > > >
> > > >
> >

[-- Attachment #2: 0001-Fix-libgloss-arc-nsim.specs-file.patch --]
[-- Type: application/octet-stream, Size: 714 bytes --]

From ead49160d6ecfa89354f3c23de0afd272f97c930 Mon Sep 17 00:00:00 2001
From: Anton Kolesov <Anton.Kolesov@synopsys.com>
Date: Wed, 11 May 2016 13:05:55 +0300
Subject: [PATCH] Fix libgloss/arc/nsim.specs file.

---
 libgloss/arc/nsim.specs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgloss/arc/nsim.specs b/libgloss/arc/nsim.specs
index ec8724c..508bdb2 100644
--- a/libgloss/arc/nsim.specs
+++ b/libgloss/arc/nsim.specs
@@ -4,7 +4,7 @@
 -lnsim
 
 *nsim_libc:
-%{!specs=nano.specsc} %{specs=nano.specsc_nano}
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
 
 *link_gcc_c_sequence:
 %(nsim_link_gcc_c_sequence) --start-group %G %(nsim_libc) %(nsim_libgloss) --end-group
-- 
2.8.1


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

* Re: [PATCH 1/3] arc: Support "nano" build of newlib
  2016-05-11 10:14           ` Anton Kolesov
@ 2016-05-11 16:47             ` Jeff Johnston
  0 siblings, 0 replies; 12+ messages in thread
From: Jeff Johnston @ 2016-05-11 16:47 UTC (permalink / raw)
  To: Anton Kolesov; +Cc: newlib, Francois Bedard

Done.

-- Jeff J.

----- Original Message -----
> One more fix of this problem, for libgloss/arc/nsim.specs, but this is the
> last one.
> 
> Anton
> 
> > -----Original Message-----
> > From: Jeff Johnston [mailto:jjohnstn@redhat.com]
> > Sent: Friday, May 06, 2016 10:58 PM
> > To: Anton Kolesov <Anton.Kolesov@synopsys.com>
> > Cc: newlib@sourceware.org; Francois Bedard <Francois.Bedard@synopsys.com>
> > Subject: Re: [PATCH 1/3] arc: Support "nano" build of newlib
> > 
> > Fixed.  I wish people would attach their patches as frequently asked on
> > this mailing list.
> > 
> > -- Jeff J.
> > 
> > ----- Original Message -----
> > > Hi Jeff,
> > >
> > > Thanks, but now I've also noticed that ":-l" disappeared from nano.specs.
> > > Attaching the patch that corrects that.
> > >
> > > Anton
> > >
> > > > -----Original Message-----
> > > > From: Jeff Johnston [mailto:jjohnstn@redhat.com]
> > > > Sent: Thursday, May 05, 2016 7:03 PM
> > > > To: Anton Kolesov <Anton.Kolesov@synopsys.com>
> > > > Cc: newlib@sourceware.org; Francois Bedard
> > > > <Francois.Bedard@synopsys.com>
> > > > Subject: Re: [PATCH 1/3] arc: Support "nano" build of newlib
> > > >
> > > > Fixed.
> > > >
> > > > -- Jeff J.
> > > >
> > > > ----- Original Message -----
> > > > > Hi Jeff,
> > > > >
> > > > > > >
> > > > > > > +$(NANO_INSTALL):
> > > > > > > +	$(mkinstalldirs) $(DESTDIR)${tooldir}/lib${MULTISUBDIR}
> > > > > > > +	for x in $(NANO_SCRIPTS); do \
> > > > > > > +	    $(INSTALL_DATA) $(srcdir)/$$x
> > > > > > > $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$$x; done
> > > > > > > +
> > > > >
> > > > > Unfortunately, tabs in Makefile.in got replaced with spaces, when
> > > > > patch
> > > > > was
> > > > > applied - so now Make complains about syntax errors in
> > > > > libgloss/arc/Makefile.
> > > > >
> > > > > Anton
> > > > >
> > > > >
> > >
> 

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

end of thread, other threads:[~2016-05-11 16:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-29 15:29 [PATCH 1/3] arc: Support "nano" build of newlib Anton Kolesov
2016-04-29 15:29 ` [PATCH 2/3] arc: Use new definitions for optional ARC CPU features in libgloss Anton Kolesov
2016-05-02 16:00   ` Jeff Johnston
2016-04-29 15:29 ` [PATCH 3/3] arc: Fix crt0.S for cores without barrel shifter Anton Kolesov
2016-05-02 16:06   ` Jeff Johnston
2016-04-29 19:18 ` [PATCH 1/3] arc: Support "nano" build of newlib Jeff Johnston
2016-05-05 11:56   ` Anton Kolesov
2016-05-05 16:03     ` Jeff Johnston
2016-05-06 19:38       ` Anton Kolesov
2016-05-06 19:57         ` Jeff Johnston
2016-05-11 10:14           ` Anton Kolesov
2016-05-11 16:47             ` 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).