aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1995-03-05 20:34:41 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1995-03-05 20:34:41 +0000
commitfcb2469be6a4e073544d63ff8612028c79db0832 (patch)
tree616df01ab2bf423177c6b43d555403452324544f
parent0f48de1c303e00d57c0b004226de4cbe012bb13f (diff)
downloadsrc-fcb2469be6a4e073544d63ff8612028c79db0832.tar.gz
src-fcb2469be6a4e073544d63ff8612028c79db0832.zip
"Various very violent dissections
disables dysfunctional disinformed namei's, needlessly negating namei cache." These hacks cuts the number futile attempts made by cc and ccp to find cross-compilers and other weird stuff. A make of the BOOTFLP kernel has 20% less namei calls now, that is from 30647 down to 24563 calls.
Notes
Notes: svn path=/head/; revision=6906
-rw-r--r--gnu/usr.bin/cc/Makefile.inc7
-rw-r--r--gnu/usr.bin/cc/cc/gcc.c34
-rw-r--r--gnu/usr.bin/cc/cpp/cccp.c5
3 files changed, 15 insertions, 31 deletions
diff --git a/gnu/usr.bin/cc/Makefile.inc b/gnu/usr.bin/cc/Makefile.inc
index fb959378d91a..8ea94bd63724 100644
--- a/gnu/usr.bin/cc/Makefile.inc
+++ b/gnu/usr.bin/cc/Makefile.inc
@@ -1,5 +1,5 @@
#
-# $Id$
+# $Id: Makefile.inc,v 1.10 1994/11/15 04:51:21 phk Exp $
#
CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../include
@@ -9,8 +9,9 @@ CFLAGS+= -DTOOL_INCLUDE_DIR=\"FOO\"
CFLAGS+= -DGPLUSPLUS_INCLUDE_DIR=\"FOO\"
CFLAGS+= -DDEFAULT_TARGET_VERSION=\"2.6.2\"
CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"i386--freebsd\"
-CFLAGS+= -DMD_EXEC_PREFIX=\"/usr/libexec/\"
-CFLAGS+= -DSTANDARD_STARTFILE_PREFIX=\"/usr/lib\"
+CFLAGS+= -DSTANDARD_EXEC_PREFIX=\"/usr/libexec/\"
+CFLAGS+= -DSTANDARD_STARTFILE_PREFIX=\"/usr/lib/\"
+CFLAGS+= -DHAVE_PUTENV
CFLAGS+= -DGCC_NAME=\"cc\"
.if exists(${.CURDIR}/../cc_int/obj)
diff --git a/gnu/usr.bin/cc/cc/gcc.c b/gnu/usr.bin/cc/cc/gcc.c
index cafd0e4f1049..0be7da20c196 100644
--- a/gnu/usr.bin/cc/cc/gcc.c
+++ b/gnu/usr.bin/cc/cc/gcc.c
@@ -31,6 +31,7 @@ Once it knows which kind of compilation to perform, the procedure for
compilation is specified by a string called a "spec". */
#include <sys/types.h>
+#include <sys/wait.h>
#include <ctype.h>
#include <signal.h>
#include <sys/stat.h>
@@ -50,6 +51,9 @@ compilation is specified by a string called a "spec". */
#include <varargs.h>
#endif
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
/* Include multi-lib information. */
#include "multilib.h"
@@ -1638,7 +1642,6 @@ putenv (str)
char **envp;
int num_envs = 0;
int name_len = 1;
- int str_len = strlen (str);
char *p = str;
int ch;
@@ -2731,13 +2734,8 @@ process_command (argc, argv)
(such as cpp) rather than those of the host system. */
/* Use 2 as fourth arg meaning try just the machine as a suffix,
as well as trying the machine and the version. */
-#ifndef OS2
- add_prefix (&exec_prefixes, standard_exec_prefix, 0, 2, NULL_PTR);
- add_prefix (&exec_prefixes, standard_exec_prefix_1, 0, 2, NULL_PTR);
-#endif
-
- add_prefix (&startfile_prefixes, standard_exec_prefix, 0, 1, NULL_PTR);
- add_prefix (&startfile_prefixes, standard_exec_prefix_1, 0, 1, NULL_PTR);
+ add_prefix (&exec_prefixes, "/usr/libexec/", 0, 0, NULL_PTR);
+ add_prefix (&exec_prefixes, "/usr/bin/", 0, 0, NULL_PTR);
tooldir_prefix = concat3 (tooldir_base_prefix, spec_machine,
dir_separator_str);
@@ -2772,13 +2770,6 @@ process_command (argc, argv)
dir_separator_str, tooldir_prefix);
}
- add_prefix (&exec_prefixes,
- concat3 (tooldir_prefix, "bin", dir_separator_str),
- 0, 0, NULL_PTR);
- add_prefix (&startfile_prefixes,
- concat3 (tooldir_prefix, "lib", dir_separator_str),
- 0, 0, NULL_PTR);
-
/* More prefixes are enabled in main, after we read the specs file
and determine whether this is cross-compilation or not. */
@@ -3784,7 +3775,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
{
int c1 = *p++; /* Select first or second version number. */
char *v = compiler_version;
- char *q, *copy;
+ char *q;
/* If desired, advance to second version number. */
if (c1 == '2')
{
@@ -4275,10 +4266,6 @@ main (argc, argv)
/* Read specs from a file if there is one. */
- machine_suffix = concat4 (spec_machine, dir_separator_str,
- spec_version, dir_separator_str);
- just_machine_suffix = concat (spec_machine, dir_separator_str);
-
specs_file = find_a_file (&startfile_prefixes, "specs", R_OK);
/* Read the specs file unless it is a default one. */
if (specs_file != 0 && strcmp (specs_file, "specs"))
@@ -4324,13 +4311,6 @@ main (argc, argv)
0, 0, NULL_PTR);
}
- add_prefix (&startfile_prefixes, standard_startfile_prefix_1, 0, 0,
- NULL_PTR);
- add_prefix (&startfile_prefixes, standard_startfile_prefix_2, 0, 0,
- NULL_PTR);
-#if 0 /* Can cause surprises, and one can use -B./ instead. */
- add_prefix (&startfile_prefixes, "./", 0, 1, NULL_PTR);
-#endif
}
/* Now we have the specs.
diff --git a/gnu/usr.bin/cc/cpp/cccp.c b/gnu/usr.bin/cc/cpp/cccp.c
index 609249ba63b7..5486eb0726bb 100644
--- a/gnu/usr.bin/cc/cpp/cccp.c
+++ b/gnu/usr.bin/cc/cpp/cccp.c
@@ -4651,6 +4651,7 @@ open_include_file (filename, searchptr)
register char *from;
char *p, *dir;
+#if 0
if (searchptr && ! searchptr->got_name_map)
{
searchptr->name_map = read_name_map (searchptr->fname
@@ -4673,7 +4674,7 @@ open_include_file (filename, searchptr)
}
}
}
-
+#endif
/* Try to find a mapping file for the particular directory we are
looking in. Thus #include <sys/types.h> will look up sys/types.h
in /usr/include/header.gcc and look up types.h in
@@ -4702,9 +4703,11 @@ open_include_file (filename, searchptr)
dir[p - filename] = '\0';
from = p + 1;
}
+#if 0
for (map = read_name_map (dir); map; map = map->map_next)
if (! strcmp (map->map_from, from))
return open (map->map_to, O_RDONLY, 0666);
+#endif
return open (filename, O_RDONLY, 0666);
}