From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13408 invoked by alias); 5 Feb 2010 20:38:01 -0000 Received: (qmail 13350 invoked by uid 22791); 5 Feb 2010 20:38:00 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_NEUTRAL X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Feb 2010 20:37:56 +0000 Received: from mail.gnu.org ([199.232.76.166]:40018 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NdUw5-0000F2-Hk for gcc@gnu.org; Fri, 05 Feb 2010 15:37:53 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NdUw3-0006mw-2F for gcc@gnu.org; Fri, 05 Feb 2010 15:37:52 -0500 Received: from mail-ew0-f228.google.com ([209.85.219.228]:53024) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NdUw2-0006lJ-GF for gcc@gnu.org; Fri, 05 Feb 2010 15:37:50 -0500 Received: by ewy28 with SMTP id 28so407320ewy.8 for ; Fri, 05 Feb 2010 12:37:47 -0800 (PST) Received: by 10.213.97.28 with SMTP id j28mr1029043ebn.44.1265402267567; Fri, 05 Feb 2010 12:37:47 -0800 (PST) Received: from ?192.168.1.66? (78-105-121-155.zone3.bethere.co.uk [78.105.121.155]) by mx.google.com with ESMTPS id 16sm1234688ewy.10.2010.02.05.12.37.43 (version=SSLv3 cipher=RC4-MD5); Fri, 05 Feb 2010 12:37:43 -0800 (PST) Message-ID: <4B6C8195.70704@jguk.org> Date: Fri, 05 Feb 2010 20:38:00 -0000 From: Jon User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Ian Lance Taylor CC: gcc@gnu.org Subject: Re: Long paths with ../../../../ throughout References: <19ac3f7a1001190934q65b08a02q37f487bd735311c3@mail.gmail.com> <19ac3f7a1001230826l5006ae86re2850bb3bbcfb629@mail.gmail.com> <4B68A953.4090107@jguk.org> <4B69F066.4080408@jguk.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------030908070403000707050202" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg00064.txt.bz2 This is a multi-part message in MIME format. --------------030908070403000707050202 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 538 Hello Ian Ian Lance Taylor wrote: [.] >> I've attached collect2 patch. Let me know what you think of it. > > There is actually a GNU standard for --help output, and collect2 might > as well follow it. > > http://www.gnu.org/prep/standards/html_node/_002d_002dhelp.html Ok, looks good, I've updated the changes, please find attached revised patch. > Do you have a copyright assignment/disclaimer with the FSF? I asked FSF this week, I'm just waiting for the snail mail to arrive. Will post it back as soon as it does. Cheers, Jon --------------030908070403000707050202 Content-Type: text/x-patch; name="collect2_help.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="collect2_help.patch" Content-length: 2718 Index: collect2.c =================================================================== --- collect2.c (revision 156482) +++ collect2.c (working copy) @@ -174,7 +174,7 @@ int number; }; -int vflag; /* true if -v */ +bool vflag; /* true if -v or --version */ static int rflag; /* true if -r */ static int strip_flag; /* true if -s */ static const char *demangle_flag; @@ -193,7 +193,8 @@ /* Current LTO mode. */ static enum lto_mode_d lto_mode = LTO_MODE_NONE; -int debug; /* true if -debug */ +bool debug; /* true if -debug */ +bool helpflag; /* true if --help */ static int shared_obj; /* true if -shared */ @@ -1228,7 +1229,7 @@ for (i = 1; argv[i] != NULL; i ++) { if (! strcmp (argv[i], "-debug")) - debug = 1; + debug = true; else if (! strcmp (argv[i], "-flto") && ! use_plugin) { use_verbose = true; @@ -1458,7 +1459,7 @@ if (use_verbose && *q == '-' && q[1] == 'v' && q[2] == 0) { /* Turn on trace in collect2 if needed. */ - vflag = 1; + vflag = true; } } obstack_free (&temporary_obstack, temporary_firstobj); @@ -1588,7 +1589,7 @@ case 'v': if (arg[2] == '\0') - vflag = 1; + vflag = true; break; case '-': @@ -1619,6 +1620,10 @@ } else if (strncmp (arg, "--sysroot=", 10) == 0) target_system_root = arg + 10; + else if (strncmp (arg, "--version", 9) == 0) + vflag = true; + else if (strncmp (arg, "--help", 9) == 0) + helpflag = true; break; } } @@ -1720,6 +1725,20 @@ fprintf (stderr, "\n"); } + if (helpflag) + { + fprintf (stderr, "Usage: collect2 [options]\n"); + fprintf (stderr, " Wrap linker and generate constructor code if needed.\n"); + fprintf (stderr, " Options:\n"); + fprintf (stderr, " -debug Enable debug output\n"); + fprintf (stderr, " --help Display this information\n"); + fprintf (stderr, " -v, --version Display this program's version number\n"); + fprintf (stderr, "Overview: http://gcc.gnu.org/onlinedocs/gccint/Collect2.html\n"); + fprintf (stderr, "Report bugs: http://gcc.gnu.org/\n"); + + collect_exit (0); + } + if (debug) { const char *ptr; Index: collect2.h =================================================================== --- collect2.h (revision 156482) +++ collect2.h (working copy) @@ -38,7 +38,7 @@ extern const char *c_file_name; extern struct obstack temporary_obstack; extern char *temporary_firstobj; -extern int vflag, debug; +extern bool vflag, debug; extern void error (const char *, ...) ATTRIBUTE_PRINTF_1; extern void notice (const char *, ...) ATTRIBUTE_PRINTF_1; --------------030908070403000707050202--