aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorJens Schweikhardt <schweikh@schweikhardt.net>2001-04-28 08:08:03 +0000
committerGerald Pfeifer <gerald@gcc.gnu.org>2001-04-28 08:08:03 +0000
commit4275c4c400d5fd3af8e40b2eb503ef548aa1dca8 (patch)
tree9994efbb89b640a792c097407c5ed582d6ace3e0 /gcc/gcc.c
parent86b8ab9e48fb576936c88905a4c0841320c2f66e (diff)
downloadgcc-4275c4c400d5fd3af8e40b2eb503ef548aa1dca8.zip
gcc-4275c4c400d5fd3af8e40b2eb503ef548aa1dca8.tar.gz
gcc-4275c4c400d5fd3af8e40b2eb503ef548aa1dca8.tar.bz2
re PR c/2347 (gcc does not accept "-l m" as POSIX permits (wants -lm))
* gcc.c (process_command): Allow -l lib in addition to -llib for POSIX compliance. This fixes PR c/2347. * invoke.texi: Update section on Link Options accordingly. From-SVN: r41655
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index b265526..9c137fa 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3287,6 +3287,14 @@ process_command (argc, argv)
n_infiles++;
i++;
}
+ else if (strcmp (argv[i], "-l") == 0)
+ {
+ if (i + 1 == argc)
+ fatal ("argument to `-l' is missing");
+
+ n_infiles++;
+ i++;
+ }
else if (strncmp (argv[i], "-l", 2) == 0)
n_infiles++;
else if (strcmp (argv[i], "-save-temps") == 0)
@@ -3728,6 +3736,12 @@ process_command (argc, argv)
infiles[n_infiles].language = "*";
infiles[n_infiles++].name = argv[++i];
}
+ else if (strcmp (argv[i], "-l") == 0)
+ { /* POSIX allows separation of -l and the lib arg;
+ canonicalize by concatenating -l with its arg */
+ infiles[n_infiles].language = "*";
+ infiles[n_infiles++].name = concat ("-l", argv[++i], NULL_PTR);
+ }
else if (strncmp (argv[i], "-l", 2) == 0)
{
infiles[n_infiles].language = "*";