This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

-X for ar and nm.



The GCC build process on AIX passes -X32_64 to ar and nm, because for
the native tools this is necessary to make stuff work.  The
functionality this turns on is the default for GNU ar and nm, and it's
convenient to have GNU ar and GNU nm take these flags so you don't
have to worry about which one you're using.

Thus this patch.  Tested on powerpc-linux.

OK to commit?

-- 
- Geoffrey Keating <geoffk@cygnus.com>

===File ~/patches/cygnus/rs6000-binu-X-2.patch==============
2000-07-26  Geoff Keating  <geoffk@cygnus.com>

	* nm.c (main): Ignore '-X32_64' as an option.
	* ar.c (main): Likewise.

Index: ar.c
===================================================================
RCS file: /cvs/src/src/binutils/ar.c,v
retrieving revision 1.16
diff -p -u -u -p -r1.16 ar.c
--- ar.c	2000/06/26 23:15:58	1.16
+++ ar.c	2000/07/26 23:29:54
@@ -431,6 +431,17 @@ main (argc, argv)
 
   xatexit (remove_output);
 
+  /* Ignored for (partial) AIX compatibility.  On AIX,
+     the -X option can be used to ignore certain kinds
+     of object files in the archive (the 64-bit objects
+     or the 32-bit objects).  GNU ar always looks at all
+     kinds of objects in an archive.  */
+  while (strcmp (argv[1], "-X32_64") == 0)
+    {
+      argv++;
+      argc--;
+    }
+
   if (is_ranlib)
     {
       boolean touch = false;
Index: nm.c
===================================================================
RCS file: /cvs/src/src/binutils/nm.c,v
retrieving revision 1.9
diff -p -u -u -p -r1.9 nm.c
--- nm.c	2000/07/20 18:02:55	1.9
+++ nm.c	2000/07/26 23:29:54
@@ -409,7 +409,7 @@ main (argc, argv)
   bfd_init ();
   set_default_bfd_target ();
 
-  while ((c = getopt_long (argc, argv, "aABCDef:glnopPrst:uvV",
+  while ((c = getopt_long (argc, argv, "aABCDef:glnopPrst:uvVX:",
 			   long_options, (int *) 0)) != EOF)
     {
       switch (c)
@@ -479,6 +479,17 @@ main (argc, argv)
 	  break;
 	case 'V':
 	  show_version = 1;
+	  break;
+	case 'X':
+	  /* Ignored for (partial) AIX compatibility.  On AIX, the
+	     argument has values 32, 64, or 32_64, and specfies that
+	     only 32-bit, only 64-bit, or both kinds of objects should
+	     be examined.  The default is 32.  So plain AIX nm on a
+	     library archive with both kinds of objects will ignore
+	     the 64-bit ones.  For GNU nm, the default is and always
+	     has been -X 32_64, and other options are not supported.  */
+	  if (strcmp (optarg, "32_64") != 0)
+	    fatal (_("Only -X 32_64 is supported"));
 	  break;
 
 	case OPTION_TARGET:	/* --target */
============================================================

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]