* [PATCH 0/3] openrisc: various fixes
@ 2017-02-06 14:38 Stafford Horne
2017-02-06 14:39 ` [PATCH 1/3] or1k: Make open reentrant Stafford Horne
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Stafford Horne @ 2017-02-06 14:38 UTC (permalink / raw)
To: newlib; +Cc: openrisc, stefan.wallentowitz, Stafford Horne
Hello,
These are a few patches that have collected in the openrisc newlib
repository on github over the last year. Most issues were found
when running the gdb test suite as I worked on getting that ready
for upstream.
I am working with Stefan Wallentowitz who has sent openrisc patches
in the past.
Olof Kindgren (1):
or1k: Make open reentrant
Stafford Horne (2):
libgloss: or1k: If available call the init for init_array
libgloss: Remove duplicate definition of environ
libgloss/or1k/crt0.S | 6 ++++++
libgloss/or1k/syscalls.c | 5 +----
2 files changed, 7 insertions(+), 4 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] libgloss: Remove duplicate definition of environ
2017-02-06 14:38 [PATCH 0/3] openrisc: various fixes Stafford Horne
2017-02-06 14:39 ` [PATCH 1/3] or1k: Make open reentrant Stafford Horne
@ 2017-02-06 14:39 ` Stafford Horne
2017-02-06 14:39 ` [PATCH 2/3] libgloss: or1k: If available call the init for init_array Stafford Horne
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Stafford Horne @ 2017-02-06 14:39 UTC (permalink / raw)
To: newlib; +Cc: openrisc, stefan.wallentowitz, Stafford Horne
Environ is defined in libgloss and libc:
- libgloss/or1k/syscalls.c
- libc/stdlib/environ.c
When linking we sometimes get errors:
or1k-elf-g++ test.o -mnewlib -mboard=or1ksim -lm -o test
/opt/shorne/software/or1k/lib/gcc/or1k-elf/5.3.0/../../../../or1k-elf/lib/libor1k.a(syscalls.o):(.data+0x0):
multiple definition of `environ'
/opt/shorne/software/or1k/lib/gcc/or1k-elf/5.3.0/../../../../or1k-elf/lib/libc.a(lib_a-environ.o):(.data+0x0):
first defined here
collect2: error: ld returned 1 exit status
This doesnt happen after the fix. Basic things build fine too.
---
libgloss/or1k/syscalls.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libgloss/or1k/syscalls.c b/libgloss/or1k/syscalls.c
index 3e2ad22..92bff49 100644
--- a/libgloss/or1k/syscalls.c
+++ b/libgloss/or1k/syscalls.c
@@ -56,9 +56,6 @@ _close_r(struct _reent *reent, int fildes)
return -1;
}
-char *__env[1] = { 0 };
-char **environ = __env;
-
int
_execve_r(struct _reent *reent, const char *name, char * const *argv,
char * const *env)
--
2.9.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] or1k: Make open reentrant
2017-02-06 14:38 [PATCH 0/3] openrisc: various fixes Stafford Horne
@ 2017-02-06 14:39 ` Stafford Horne
2017-02-06 14:39 ` [PATCH 3/3] libgloss: Remove duplicate definition of environ Stafford Horne
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Stafford Horne @ 2017-02-06 14:39 UTC (permalink / raw)
To: newlib; +Cc: openrisc, stefan.wallentowitz, Olof Kindgren
From: Olof Kindgren <olof.kindgren@gmail.com>
or1k uses reentrant calls by default, but there was no open_r defined
which caused failure in C++/C code such as:
int main() { std::cout << "test\n"; return 0; }
or
int main() {open(".", 0);}
---
libgloss/or1k/syscalls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgloss/or1k/syscalls.c b/libgloss/or1k/syscalls.c
index 690d21a..3e2ad22 100644
--- a/libgloss/or1k/syscalls.c
+++ b/libgloss/or1k/syscalls.c
@@ -124,7 +124,7 @@ _lseek_r(struct _reent *reent, int file, _off_t ptr, int dir)
}
int
-_open(struct _reent *reent, char *file, int flags, int mode)
+_open_r(struct _reent *reent, const char *file, int flags, int mode)
{
reent->_errno = ENOSYS;
return -1;
--
2.9.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] libgloss: or1k: If available call the init for init_array
2017-02-06 14:38 [PATCH 0/3] openrisc: various fixes Stafford Horne
2017-02-06 14:39 ` [PATCH 1/3] or1k: Make open reentrant Stafford Horne
2017-02-06 14:39 ` [PATCH 3/3] libgloss: Remove duplicate definition of environ Stafford Horne
@ 2017-02-06 14:39 ` Stafford Horne
2017-02-13 8:20 ` [PATCH 0/3] openrisc: various fixes Corinna Vinschen
2017-03-15 11:44 ` Stafford Horne
4 siblings, 0 replies; 7+ messages in thread
From: Stafford Horne @ 2017-02-06 14:39 UTC (permalink / raw)
To: newlib; +Cc: openrisc, stefan.wallentowitz, Stafford Horne
There was an issue revealed in gdb testing where C++ virtual tables
were not getting properly initialized. This seems to be due to the
c++ global constructors moving from ctors to init_array.
This fix makes sure we call the proper method for initializing the
constructors in all places.
---
libgloss/or1k/crt0.S | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libgloss/or1k/crt0.S b/libgloss/or1k/crt0.S
index 84adba1..03d7323 100644
--- a/libgloss/or1k/crt0.S
+++ b/libgloss/or1k/crt0.S
@@ -36,6 +36,7 @@
the obvious things.. */
/* -------------------------------------------------------------------------- */
+#include "newlib.h"
#include "include/or1k-asm.h"
#include "include/or1k-sprs.h"
@@ -96,6 +97,11 @@ _or1k_exception_stack_size: .word EXCEPTION_STACK_SIZE
*/
/* -------------------------------------------------------------------------- */
+#ifdef HAVE_INITFINI_ARRAY
+#define _init __libc_init_array
+#define _fini __libc_fini_array
+#endif
+
#define GPR_BUF_OFFSET(x) (x << 2)
#ifndef __OR1K_MULTICORE__
--
2.9.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] openrisc: various fixes
2017-02-06 14:38 [PATCH 0/3] openrisc: various fixes Stafford Horne
` (2 preceding siblings ...)
2017-02-06 14:39 ` [PATCH 2/3] libgloss: or1k: If available call the init for init_array Stafford Horne
@ 2017-02-13 8:20 ` Corinna Vinschen
2017-03-15 11:44 ` Stafford Horne
4 siblings, 0 replies; 7+ messages in thread
From: Corinna Vinschen @ 2017-02-13 8:20 UTC (permalink / raw)
To: newlib
[-- Attachment #1: Type: text/plain, Size: 812 bytes --]
On Feb 6 23:38, Stafford Horne wrote:
> Hello,
>
> These are a few patches that have collected in the openrisc newlib
> repository on github over the last year. Most issues were found
> when running the gdb test suite as I worked on getting that ready
> for upstream.
>
> I am working with Stefan Wallentowitz who has sent openrisc patches
> in the past.
>
> Olof Kindgren (1):
> or1k: Make open reentrant
>
> Stafford Horne (2):
> libgloss: or1k: If available call the init for init_array
> libgloss: Remove duplicate definition of environ
>
> libgloss/or1k/crt0.S | 6 ++++++
> libgloss/or1k/syscalls.c | 5 +----
> 2 files changed, 7 insertions(+), 4 deletions(-)
>
> --
> 2.9.3
Pushed.
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] openrisc: various fixes
2017-02-06 14:38 [PATCH 0/3] openrisc: various fixes Stafford Horne
` (3 preceding siblings ...)
2017-02-13 8:20 ` [PATCH 0/3] openrisc: various fixes Corinna Vinschen
@ 2017-03-15 11:44 ` Stafford Horne
2017-03-15 22:10 ` Stafford Horne
4 siblings, 1 reply; 7+ messages in thread
From: Stafford Horne @ 2017-03-15 11:44 UTC (permalink / raw)
To: newlib; +Cc: Openrisc, Stefan Wallentowitz, Stafford Horne
Hello,
Any comment on this series?
On Mon, Feb 6, 2017 at 11:38 PM, Stafford Horne <shorne@gmail.com> wrote:
> Hello,
>
> These are a few patches that have collected in the openrisc newlib
> repository on github over the last year. Most issues were found
> when running the gdb test suite as I worked on getting that ready
> for upstream.
>
> I am working with Stefan Wallentowitz who has sent openrisc patches
> in the past.
>
> Olof Kindgren (1):
> or1k: Make open reentrant
>
> Stafford Horne (2):
> libgloss: or1k: If available call the init for init_array
> libgloss: Remove duplicate definition of environ
>
> libgloss/or1k/crt0.S | 6 ++++++
> libgloss/or1k/syscalls.c | 5 +----
> 2 files changed, 7 insertions(+), 4 deletions(-)
>
> --
> 2.9.3
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] openrisc: various fixes
2017-03-15 11:44 ` Stafford Horne
@ 2017-03-15 22:10 ` Stafford Horne
0 siblings, 0 replies; 7+ messages in thread
From: Stafford Horne @ 2017-03-15 22:10 UTC (permalink / raw)
To: newlib; +Cc: Openrisc, Stefan Wallentowitz
On Wed, Mar 15, 2017 at 08:44:34PM +0900, Stafford Horne wrote:
> Hello,
>
> Any comment on this series?
Sorry, my mistake Corinna replied on this but I missed it.
https://sourceware.org/ml/newlib/2017/msg00139.html
> On Mon, Feb 6, 2017 at 11:38 PM, Stafford Horne <shorne@gmail.com> wrote:
> > Hello,
> >
> > These are a few patches that have collected in the openrisc newlib
> > repository on github over the last year. Most issues were found
> > when running the gdb test suite as I worked on getting that ready
> > for upstream.
> >
> > I am working with Stefan Wallentowitz who has sent openrisc patches
> > in the past.
> >
> > Olof Kindgren (1):
> > or1k: Make open reentrant
> >
> > Stafford Horne (2):
> > libgloss: or1k: If available call the init for init_array
> > libgloss: Remove duplicate definition of environ
> >
> > libgloss/or1k/crt0.S | 6 ++++++
> > libgloss/or1k/syscalls.c | 5 +----
> > 2 files changed, 7 insertions(+), 4 deletions(-)
> >
> > --
> > 2.9.3
> >
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-03-15 22:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-06 14:38 [PATCH 0/3] openrisc: various fixes Stafford Horne
2017-02-06 14:39 ` [PATCH 1/3] or1k: Make open reentrant Stafford Horne
2017-02-06 14:39 ` [PATCH 3/3] libgloss: Remove duplicate definition of environ Stafford Horne
2017-02-06 14:39 ` [PATCH 2/3] libgloss: or1k: If available call the init for init_array Stafford Horne
2017-02-13 8:20 ` [PATCH 0/3] openrisc: various fixes Corinna Vinschen
2017-03-15 11:44 ` Stafford Horne
2017-03-15 22:10 ` Stafford Horne
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).