public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] libgloss: Remove duplicate definition of environ
@ 2017-02-13 8:19 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2017-02-13 8:19 UTC (permalink / raw)
To: newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=135c0c83680d5d39bfe326e497ace47c0bff1650
commit 135c0c83680d5d39bfe326e497ace47c0bff1650
Author: Stafford Horne <shorne@gmail.com>
Date: Mon Feb 6 23:38:40 2017 +0900
libgloss: Remove duplicate definition of environ
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.
Diff:
---
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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-02-13 8:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-13 8:19 [newlib-cygwin] libgloss: Remove duplicate definition of environ Corinna Vinschen
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).