From: tromey Date: Thu, 12 Nov 1998 08:50:52 +0000 (+0000) Subject: * jvspec.c (lang_specific_driver): Correctly handle case where X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c37492b0014292e0bff20003af24425eff1e584c;p=platform%2Fupstream%2Flinaro-gcc.git * jvspec.c (lang_specific_driver): Correctly handle case where GC_NAME not defined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23614 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 0610160..8e331ee 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +1998-11-12 Tom Tromey + + * jvspec.c (lang_specific_driver): Correctly handle case where + GC_NAME not defined. + 1998-11-11 Tom Tromey * jvspec.c (GC_NAME): New define. diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c index 4b44ba0..ba17d09 100644 --- a/gcc/java/jvspec.c +++ b/gcc/java/jvspec.c @@ -172,6 +172,9 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) */ int need_thread = 1; + /* By default, we throw in the gc library (if one is required). */ + int need_gc = 1; + /* The total number of arguments with the new stuff. */ int argc; @@ -235,8 +238,13 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) saw_libjava = 1; else if (strcmp (argv[i], "-lc") == 0) args[i] |= WITHLIBC; +#ifdef GC_NAME else if (strcmp (argv[i], GC_NAME) == 0) - args[i] |= GCLIB; + { + args[i] |= GCLIB; + need_gc = 0; + } +#endif #ifdef THREAD_NAME else if (strcmp (argv[i], THREAD_NAME) == 0) { @@ -333,7 +341,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) num_args = argc + added; if (will_link) - num_args += need_math + need_thread; + num_args += need_math + need_thread + need_gc; if (saw_C) { num_args += 3; @@ -376,7 +384,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) { lang_specific_extra_outfiles++; } - arglist = (char **) xmalloc ((num_args + 4) * sizeof (char *)); + arglist = (char **) xmalloc ((num_args + 1) * sizeof (char *)); for (i = 0, j = 0; i < argc; i++, j++) {