public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* COLLECT_GCC_OPTIONS broken on trunk and gcc-3.0 branch
@ 2001-08-08 11:45 David Edelsohn
  2001-08-08 11:48 ` David Edelsohn
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: David Edelsohn @ 2001-08-08 11:45 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Mark Mitchell, gcc

	Rainer's patch has broken COLLET_GCC_OPTIONS.  With his patch,
COLLECT_GCC_OPTIONS on AIX is *empty*.  When building libgcc2, before his
patch, collect2 shows:

COLLECT_GCC_OPTIONS = '-B./' '-O2' '-DIN_GCC' '-W' '-Wall'
'-Wwrite-strings' '-W strict-prototypes' '-Wmissing-prototypes' '-isystem'
'./include' '-g1' '-DHAVE_G THR_DEFAULT' '-DIN_LIBGCC2'
'-D__GCC_FLOAT_NOT_NEEDED' '-shared' '-nodefaultlibs ' '-o' 'fooshr.o'
'-maix64'

After his patch:

COLLECT_GCC_OPTIONS is not present whatsoever.

	This causes errors like:

ld: 0711-738 ERROR: Input file /tmp//ccwSK62O.o:
        XCOFF32 object files are not allowed in 64-bit mode.

when bootstrapping on AIX because collect2 does not invoke xgcc with the
-maix64 option.

	This is a regression from gcc-3.0.  I am opening a PR and marking
it as high priority.  This causes build failures on both the trunk and the
branch. 

David

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COLLECT_GCC_OPTIONS broken on trunk and gcc-3.0 branch
  2001-08-08 11:45 COLLECT_GCC_OPTIONS broken on trunk and gcc-3.0 branch David Edelsohn
@ 2001-08-08 11:48 ` David Edelsohn
  2001-08-08 12:07   ` Mark Mitchell
  2001-08-08 12:04 ` David Edelsohn
  2001-08-08 12:05 ` Mark Mitchell
  2 siblings, 1 reply; 9+ messages in thread
From: David Edelsohn @ 2001-08-08 11:48 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: gcc

	I just received an automated reply from Rainer's account that he
is on vacation until September 10.

David

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COLLECT_GCC_OPTIONS broken on trunk and gcc-3.0 branch
  2001-08-08 11:45 COLLECT_GCC_OPTIONS broken on trunk and gcc-3.0 branch David Edelsohn
  2001-08-08 11:48 ` David Edelsohn
@ 2001-08-08 12:04 ` David Edelsohn
  2001-08-08 12:05 ` Mark Mitchell
  2 siblings, 0 replies; 9+ messages in thread
From: David Edelsohn @ 2001-08-08 12:04 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: gcc

	One more detail: the failure occurs if one is linking object files
without compiling any files.  If a source file is present on the command
line, COLLECT_GCC_OPTIONS is defined.  If no source file is present,
COLLECT_GCC_OPTIONS never is defined in the environment.

David

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COLLECT_GCC_OPTIONS broken on trunk and gcc-3.0 branch
  2001-08-08 11:45 COLLECT_GCC_OPTIONS broken on trunk and gcc-3.0 branch David Edelsohn
  2001-08-08 11:48 ` David Edelsohn
  2001-08-08 12:04 ` David Edelsohn
@ 2001-08-08 12:05 ` Mark Mitchell
  2 siblings, 0 replies; 9+ messages in thread
From: Mark Mitchell @ 2001-08-08 12:05 UTC (permalink / raw)
  To: David Edelsohn, Rainer Orth; +Cc: gcc

--On Wednesday, August 08, 2001 02:44:32 PM -0400 David Edelsohn 
<dje@watson.ibm.com> wrote:

> 	Rainer's patch has broken COLLET_GCC_OPTIONS.  With his patch,
> COLLECT_GCC_OPTIONS on AIX is *empty*.  When building libgcc2, before his
> patch, collect2 shows:

Rainer --

  We will need to fix this problem, or revert the patch very quickly.
Please let us know if you are unable to fix the problem right away.

  Thanks,

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COLLECT_GCC_OPTIONS broken on trunk and gcc-3.0 branch
  2001-08-08 11:48 ` David Edelsohn
@ 2001-08-08 12:07   ` Mark Mitchell
  2001-08-09 20:46     ` David Edelsohn
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Mitchell @ 2001-08-08 12:07 UTC (permalink / raw)
  To: David Edelsohn; +Cc: gcc

--On Wednesday, August 08, 2001 02:47:33 PM -0400 David Edelsohn 
<dje@watson.ibm.com> wrote:

> 	I just received an automated reply from Rainer's account that he
> is on vacation until September 10.

OK.

Please revert Rainer's patch on the 3.0 branch, and verify that
this solves the problem.  On the mainline, we should wait the requisite
48 hours to see if anyone else steps up to solve the problem; if not,
we have one vote to revert the patch (mine) and we will need another
to revert it.

Thanks,

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COLLECT_GCC_OPTIONS broken on trunk and gcc-3.0 branch
  2001-08-08 12:07   ` Mark Mitchell
@ 2001-08-09 20:46     ` David Edelsohn
  2001-08-09 22:30       ` Mark Mitchell
  2001-08-10 13:03       ` Alexandre Petit-Bianco
  0 siblings, 2 replies; 9+ messages in thread
From: David Edelsohn @ 2001-08-09 20:46 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: gcc, java

>>>>> Mark Mitchell writes:

Mark> Please revert Rainer's patch on the 3.0 branch, and verify that
Mark> this solves the problem.  On the mainline, we should wait the requisite
Mark> 48 hours to see if anyone else steps up to solve the problem; if not,
Mark> we have one vote to revert the patch (mine) and we will need another
Mark> to revert it.

	No one has stepped up to fix this.  Removing the patch does fix
the problem.

	Reverting Rainer's patch on the branch means reverting the latest
Java fixes on the branch as well because they use the gcc.c changes.  This
is getting complicated.

	I guess that I need to revert everything unless the Java
developers step up to the plate.

David

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COLLECT_GCC_OPTIONS broken on trunk and gcc-3.0 branch
  2001-08-09 20:46     ` David Edelsohn
@ 2001-08-09 22:30       ` Mark Mitchell
  2001-08-10 13:03       ` Alexandre Petit-Bianco
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Mitchell @ 2001-08-09 22:30 UTC (permalink / raw)
  To: David Edelsohn; +Cc: gcc, java

> 	I guess that I need to revert everything unless the Java
> developers step up to the plate.

Yes.  Java folks, please help!  Otherwise, David, you have my
standing vote to revert the changes.

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COLLECT_GCC_OPTIONS broken on trunk and gcc-3.0 branch
  2001-08-09 20:46     ` David Edelsohn
  2001-08-09 22:30       ` Mark Mitchell
@ 2001-08-10 13:03       ` Alexandre Petit-Bianco
  2001-08-11  9:02         ` Alexandre Petit-Bianco
  1 sibling, 1 reply; 9+ messages in thread
From: Alexandre Petit-Bianco @ 2001-08-10 13:03 UTC (permalink / raw)
  To: gcc

David Edelsohn <dje@watson.ibm.com> writes:

> 	Reverting Rainer's patch on the branch means reverting the
> latest Java fixes on the branch as well because they use the gcc.c
> changes.  This is getting complicated.

I'm looking into this. Sorry about stepping in late.

./A

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COLLECT_GCC_OPTIONS broken on trunk and gcc-3.0 branch
  2001-08-10 13:03       ` Alexandre Petit-Bianco
@ 2001-08-11  9:02         ` Alexandre Petit-Bianco
  0 siblings, 0 replies; 9+ messages in thread
From: Alexandre Petit-Bianco @ 2001-08-11  9:02 UTC (permalink / raw)
  To: gcc

The following message is a courtesy copy of an article
that has been posted as well.


> I'm looking into this. Sorry about stepping in late.

I guess the patch should be reverted in its entirety. I looked a bit
at the gcc part and I couldn't see what's obviously wrong with it.

We could keep a few hunks from the Java part, but it's not worth it
for now: Rainer will eventually fix this patch and re-install it at
some point. I will have to re-open PR java/227.

Here's what should be applied to the branch. 

./A

gcc:

2001-08-10  Alexandre Petit-Bianco  <apbianco@redhat.com>

	Reverted:
	2001-08-02  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
	* gcc.c (set_collect_gcc_options): New function, split out from
	main.
	Ignore elided switches.
	(do_spec_1): Invoke before executing command.
	(set_input): Export.
	Move declaration ...
	* gcc.h (set_input): ... here.
	* config/alpha/osf.h (ASM_FINAL_SPEC): Use %U.s to refer to input
	file.

gcc/java:

2001-08-10  Alexandre Petit-Bianco  <apbianco@redhat.com>

	Reverted:
	2001-08-02  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
	* 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.

Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.205.2.19
diff -u -p -r1.205.2.19 gcc.c
--- gcc.c	2001/08/02 12:22:49	1.205.2.19
+++ gcc.c	2001/08/10 21:08:20
@@ -243,7 +243,6 @@ static void clear_failure_queue PARAMS (
 static int check_live_switch	PARAMS ((int, int));
 static const char *handle_braces PARAMS ((const char *));
 static char *save_string	PARAMS ((const char *, int));
-static void set_collect_gcc_options PARAMS ((void));
 static int do_spec_1		PARAMS ((const char *, int, const char *));
 static const char *find_file	PARAMS ((const char *));
 static int is_directory		PARAMS ((const char *, const char *, int));
@@ -267,6 +266,7 @@ static void process_command		PARAMS ((in
 static int execute			PARAMS ((void));
 static void clear_args			PARAMS ((void));
 static void fatal_error			PARAMS ((int));
+static void set_input			PARAMS ((const char *));
 static void init_gcc_specs              PARAMS ((struct obstack *,
 						 const char *,
 						 const char *));
@@ -3869,63 +3869,6 @@ process_command (argc, argv)
   switches[n_switches].part1 = 0;
   infiles[n_infiles].name = 0;
 }
-
-/* Store switches not filtered out but %{<S} in spec in COLLECT_GCC_OPTIONS
-   and place that in the environment.  */
-
-static void
-set_collect_gcc_options ()
-{
-  int i;
-  int first_time;
-
-  /* Build COLLECT_GCC_OPTIONS to have all of the options specified to
-     the compiler.  */
-  obstack_grow (&collect_obstack, "COLLECT_GCC_OPTIONS=",
-		sizeof ("COLLECT_GCC_OPTIONS=") - 1);
-
-  first_time = TRUE;
-  for (i = 0; (int) i < n_switches; i++)
-    {
-      const char *const *args;
-      const char *p, *q;
-      if (!first_time)
-	obstack_grow (&collect_obstack, " ", 1);
-
-      first_time = FALSE;
-
-      /* Ignore elided switches.  */
-      if (switches[i].live_cond == SWITCH_IGNORE)
-	continue;
-
-      obstack_grow (&collect_obstack, "'-", 2);
-      q = switches[i].part1;
-      while ((p = strchr (q, '\'')))
-	{
-	  obstack_grow (&collect_obstack, q, p - q);
-	  obstack_grow (&collect_obstack, "'\\''", 4);
-	  q = ++p;
-	}
-      obstack_grow (&collect_obstack, q, strlen (q));
-      obstack_grow (&collect_obstack, "'", 1);
-
-      for (args = switches[i].args; args && *args; args++)
-	{
-	  obstack_grow (&collect_obstack, " '", 2);
-	  q = *args;
-	  while ((p = strchr (q, '\'')))
-	    {
-	      obstack_grow (&collect_obstack, q, p - q);
-	      obstack_grow (&collect_obstack, "'\\''", 4);
-	      q = ++p;
-	    }
-	  obstack_grow (&collect_obstack, q, strlen (q));
-	  obstack_grow (&collect_obstack, "'", 1);
-	}
-    }
-  obstack_grow (&collect_obstack, "\0", 1);
-  putenv (obstack_finish (&collect_obstack));
-}
 \f
 /* Process a spec string, accumulating and running commands.  */
 
@@ -4069,8 +4012,6 @@ do_spec_1 (spec, inswitch, soft_matched_
 	      argbuf_index--;
 	  }
 
-	set_collect_gcc_options ();
-
 	if (argbuf_index > 0)
 	  {
 	    value = execute ();
@@ -5454,7 +5395,7 @@ is_directory (path1, path2, linker)
 /* Set up the various global variables to indicate that we're processing
    the input file named FILENAME.  */
 
-void
+static void
 set_input (filename)
      const char *filename;
 {
@@ -5626,6 +5567,52 @@ main (argc, argv)
      Decode switches that are handled locally.  */
 
   process_command (argc, argv);
+
+  {
+    int first_time;
+
+    /* Build COLLECT_GCC_OPTIONS to have all of the options specified to
+       the compiler.  */
+    obstack_grow (&collect_obstack, "COLLECT_GCC_OPTIONS=",
+		  sizeof ("COLLECT_GCC_OPTIONS=") - 1);
+
+    first_time = TRUE;
+    for (i = 0; (int) i < n_switches; i++)
+      {
+	const char *const *args;
+	const char *p, *q;
+	if (!first_time)
+	  obstack_grow (&collect_obstack, " ", 1);
+
+	first_time = FALSE;
+	obstack_grow (&collect_obstack, "'-", 2);
+	q = switches[i].part1;
+	while ((p = strchr (q, '\'')))
+	  {
+	    obstack_grow (&collect_obstack, q, p - q);
+	    obstack_grow (&collect_obstack, "'\\''", 4);
+	    q = ++p;
+	  }
+	obstack_grow (&collect_obstack, q, strlen (q));
+	obstack_grow (&collect_obstack, "'", 1);
+
+	for (args = switches[i].args; args && *args; args++)
+	  {
+	    obstack_grow (&collect_obstack, " '", 2);
+	    q = *args;
+	    while ((p = strchr (q, '\'')))
+	      {
+		obstack_grow (&collect_obstack, q, p - q);
+		obstack_grow (&collect_obstack, "'\\''", 4);
+		q = ++p;
+	      }
+	    obstack_grow (&collect_obstack, q, strlen (q));
+	    obstack_grow (&collect_obstack, "'", 1);
+	  }
+      }
+    obstack_grow (&collect_obstack, "\0", 1);
+    putenv (obstack_finish (&collect_obstack));
+  }
 
   /* Initialize the vector of specs to just the default.
      This means one element containing 0s, as a terminator.  */
Index: gcc.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.h,v
retrieving revision 1.3.6.3
diff -u -p -r1.3.6.3 gcc.h
--- gcc.h	2001/08/02 12:22:50	1.3.6.3
+++ gcc.h	2001/08/10 21:08:20
@@ -1,5 +1,5 @@
 /* Header file for modules that link with gcc.c
-   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -33,7 +33,6 @@ extern void fatal PARAMS ((const char *,
      ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 extern void error PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
 extern void pfatal_with_name PARAMS ((const char *)) ATTRIBUTE_NORETURN;
-extern void set_input PARAMS ((const char *));
 
 /* Spec files linked with gcc.c must provide definitions for these. */
 
Index: java/jvgenmain.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jvgenmain.c,v
retrieving revision 1.23.2.2
diff -u -p -r1.23.2.2 jvgenmain.c
--- jvgenmain.c	2001/08/02 12:22:54	1.23.2.2
+++ jvgenmain.c	2001/08/10 21:08:20
@@ -62,14 +62,14 @@ static void usage (const char *) ATTRIBU
 static void
 usage (const char *name)
 {
-  fprintf (stderr, "Usage: %s [OPTIONS]... CLASSNAMEmain [OUTFILE]\n", name);
+  fprintf (stderr, "Usage: %s [OPTIONS]... CLASSNAME [OUTFILE]\n", name);
   exit (1);
 }
 
 int
-main (int argc, char **argv)
+main (int argc, const char **argv)
 {
-  char *classname, *p;
+  const char *classname;
   FILE *stream;
   const char *mangled_classname;
   int i, last_arg;
@@ -92,13 +92,6 @@ main (int argc, char **argv)
   last_arg = i;
 
   classname = argv[i];
-
-  /* gcj always appends `main' to classname.  We need to strip this here.  */
-  p = strrchr (classname, 'm');
-  if (p == NULL || p == classname || strcmp (p, "main") != 0)
-    usage (argv[0]);
-  else
-    *p = '\0';
 
   gcc_obstack_init (mangle_obstack);
   mangled_classname = do_mangle_classname (classname);
Index: java/jvspec.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jvspec.c,v
retrieving revision 1.35.2.7
diff -u -p -r1.35.2.7 jvspec.c
--- jvspec.c	2001/08/02 12:22:54	1.35.2.7
+++ jvspec.c	2001/08/10 21:08:20
@@ -52,8 +52,8 @@ int lang_specific_extra_outfiles = 0;
 int shared_libgcc = 1;
 
 const char jvgenmain_spec[] =
-  "jvgenmain %{D*} %b %{!pipe:%u.i} |\n\
-   cc1 %{!pipe:%U.i} %1 \
+  "jvgenmain %{D*} %i %{!pipe:%umain.i} |\n\
+   cc1 %{!pipe:%Umain.i} %1 \
 		   %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
 		   %{g*} %{O*} \
 		   %{v:-version} %{pg:-p} %{p}\
@@ -67,8 +67,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:%U.s}} |\n\
-              %{!S:as %a %Y -o %d%w%u%O %{!pipe:%U.s} %A\n }";
+		   %{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 }";
 
 /* Return full path name of spec file if it is in DIR, or NULL if
    not.  */
@@ -528,14 +528,8 @@ lang_specific_pre_link ()
   int err;
   if (main_class_name == NULL)
     return 0;
-  /* 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));
+  input_filename = main_class_name;
+  input_filename_length = strlen (main_class_name);
   err = do_spec (jvgenmain_spec);
   if (err == 0)
     {

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-08-11  9:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-08 11:45 COLLECT_GCC_OPTIONS broken on trunk and gcc-3.0 branch David Edelsohn
2001-08-08 11:48 ` David Edelsohn
2001-08-08 12:07   ` Mark Mitchell
2001-08-09 20:46     ` David Edelsohn
2001-08-09 22:30       ` Mark Mitchell
2001-08-10 13:03       ` Alexandre Petit-Bianco
2001-08-11  9:02         ` Alexandre Petit-Bianco
2001-08-08 12:04 ` David Edelsohn
2001-08-08 12:05 ` Mark Mitchell

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).