From c5a2e0123b7241be6a2022f1acb8fa700dda628a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 15 May 2021 08:43:36 -0400 Subject: sim: switch to libiberty environ.h Drop our compat code and assume environ exists to simplify. --- sim/common/ChangeLog | 6 ++++++ sim/common/nrun.c | 9 +-------- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'sim/common') diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index b360ebd..b221166 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,9 @@ +2021-05-15 Mike Frysinger + + * nrun.c: Include environ.h. + (environ): Delete prototype. + (main): Delete HAVE_ENVIRON check. + 2021-05-14 Mike Frysinger * callback.c (os_lseek): Change return and 3rd arg to int64_t. diff --git a/sim/common/nrun.c b/sim/common/nrun.c index 1ceb083..8a1b3c1 100644 --- a/sim/common/nrun.c +++ b/sim/common/nrun.c @@ -27,16 +27,13 @@ along with this program. If not, see . */ #include "sim-main.h" #include "bfd.h" +#include "environ.h" #ifndef HAVE_STRSIGNAL /* While libiberty provides a fallback, it doesn't provide a prototype. */ extern const char *strsignal (int); #endif -#ifdef HAVE_ENVIRON -extern char **environ; -#endif - #ifdef HAVE_UNISTD_H /* For chdir. */ #include @@ -133,11 +130,7 @@ main (int argc, char **argv) exit (1); /* Prepare the program for execution. */ -#ifdef HAVE_ENVIRON sim_create_inferior (sd, prog_bfd, prog_argv, environ); -#else - sim_create_inferior (sd, prog_bfd, prog_argv, NULL); -#endif /* To accommodate relative file paths, chdir to sysroot now. We mustn't do this until BFD has opened the program, else we wouldn't -- cgit v1.1