diff options
author | Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> | 2001-11-27 17:31:38 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2001-11-27 17:31:38 +0000 |
commit | b856c15d7e97280853a83042ccb3ba29c79e7e9f (patch) | |
tree | ee26d5564cb1ec6bb1e597398f2094f13bbfc5c2 /gcc/java/jvspec.c | |
parent | ae08d4c0e94fd3f08cd1e47ed92b1fb1628f15e2 (diff) | |
download | gcc-b856c15d7e97280853a83042ccb3ba29c79e7e9f.zip gcc-b856c15d7e97280853a83042ccb3ba29c79e7e9f.tar.gz gcc-b856c15d7e97280853a83042ccb3ba29c79e7e9f.tar.bz2 |
re PR other/3968 (COLLECT_GCC_OPTIONS empty)
* gcc.c (set_collect_gcc_options): New function, split out from
main.
Ignore elided switches.
(do_spec): Invoke before executing command.
(do_spec_1): Likewise.
Fixes PR other/3968.
* gcc.c (set_input): Export.
Move declaration ...
gcc.h (set_input): ... here.
java:
* jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
ASM_FINAL_SPEC.
(lang_specific_pre_link): Use set_input to set input_filename.
Append `main' here.
* jvgenmain.c (usage): Append literal `main' to CLASSNAME.
(main): Fix definition.
Strip `main' from classname.
Fixes PR java/227.
From-SVN: r47385
Diffstat (limited to 'gcc/java/jvspec.c')
-rw-r--r-- | gcc/java/jvspec.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c index 53bd23d..0150d03 100644 --- a/gcc/java/jvspec.c +++ b/gcc/java/jvspec.c @@ -54,8 +54,8 @@ int lang_specific_extra_outfiles = 0; int shared_libgcc = 1; const char jvgenmain_spec[] = - "jvgenmain %{D*} %i %{!pipe:%umain.i} |\n\ - cc1 %{!pipe:%Umain.i} %1 \ + "jvgenmain %{D*} %b %{!pipe:%u.i} |\n\ + cc1 %{!pipe:%U.i} %1 \ %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\ %{g*} %{O*} \ %{v:-version} %{pg:-p} %{p}\ @@ -71,8 +71,8 @@ const char jvgenmain_spec[] = %{f*} -fdollars-in-identifiers\ %{aux-info*}\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ - %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%Umain.s}} |\n\ - %{!S:as %a %Y -o %d%w%umain%O %{!pipe:%Umain.s} %A\n }"; + %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ + %{!S:as %a %Y -o %d%w%u%O %{!pipe:%g.s} %A\n }"; /* Return full path name of spec file if it is in DIR, or NULL if not. */ @@ -571,8 +571,14 @@ lang_specific_pre_link () int err; if (main_class_name == NULL) return 0; - input_filename = main_class_name; - input_filename_length = strlen (main_class_name); + /* Append `main' to make the filename unique and allow + + gcj --main=hello -save-temps hello.java + + to work. jvgenmain needs to strip this `main' to arrive at the correct + class name. Append dummy `.c' that can be stripped by set_input so %b + is correct. */ + set_input (concat (main_class_name, "main.c", NULL)); err = do_spec (jvgenmain_spec); if (err == 0) { |