Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
07804c3b
Commit
07804c3b
authored
Jun 30, 2001
by
Nick Clifton
Committed by
Nick Clifton
Jun 30, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Append a DIR_SEPARATOR to a path specified by the -B switch, if doing so would
create a valid directory name. From-SVN: r43664
parent
bc2fa2fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
23 deletions
+57
-23
gcc/ChangeLog
+7
-0
gcc/doc/invoke.texi
+8
-0
gcc/gcc.c
+42
-23
No files found.
gcc/ChangeLog
View file @
07804c3b
2001
-
06
-
29
Nick
Clifton
<
nickc
@cambridge
.
redhat
.
com
>
*
gcc
.
c
(
process_command
)
:
Append
a
DIR_SEPARATOR
to
a
path
specified
by
the
-
B
switch
,
if
doing
so
would
create
a
valid
directory
name
.
*
doc
/
invoke
.
texi
:
Document
changed
behaviour
of
-
B
.
2001
-
06
-
29
DJ
Delorie
<
dj
@redhat
.
com
>
2001
-
06
-
29
DJ
Delorie
<
dj
@redhat
.
com
>
*
simplify
-
rtx
.
c
(
simplify_subreg
)
:
When
simplifying
a
CONCAT
,
at
*
simplify
-
rtx
.
c
(
simplify_subreg
)
:
When
simplifying
a
CONCAT
,
at
...
...
gcc/doc/invoke.texi
View file @
07804c3b
...
@@ -4398,6 +4398,10 @@ those results in a file name that is found, the unmodified program
...
@@ -4398,6 +4398,10 @@ those results in a file name that is found, the unmodified program
name is searched for using the directories specified in your
name is searched for using the directories specified in your
@env{PATH} environment variable.
@env{PATH} environment variable.
The compiler will check to see if the path provided by the @option{-B}
refers to a directory, and if necessary it will add a directory
separator character at the end of the path.
@option{-B} prefixes that effectively specify directory names also apply
@option{-B} prefixes that effectively specify directory names also apply
to libraries in the linker, because the compiler translates these
to libraries in the linker, because the compiler translates these
options into @option{-L} options for the linker. They also apply to
options into @option{-L} options for the linker. They also apply to
...
@@ -4414,6 +4418,10 @@ Another way to specify a prefix much like the @option{-B} prefix is to use
...
@@ -4414,6 +4418,10 @@ Another way to specify a prefix much like the @option{-B} prefix is to use
the environment variable @env{GCC_EXEC_PREFIX}. @xref{Environment
the environment variable @env{GCC_EXEC_PREFIX}. @xref{Environment
Variables}.
Variables}.
As a special kludge, if the path provided by @option{-B} is
@samp{[foo/]stage<N>/} then it will be replaced by
@samp{[foo/]include}. This is to help with boot-strapping the compiler.
@item -specs=@var{file}
@item -specs=@var{file}
@opindex specs
@opindex specs
Process @var{file} after the compiler reads in the standard @file{specs}
Process @var{file} after the compiler reads in the standard @file{specs}
...
...
gcc/gcc.c
View file @
07804c3b
...
@@ -3366,36 +3366,55 @@ process_command (argc, argv)
...
@@ -3366,36 +3366,55 @@ process_command (argc, argv)
case
'B'
:
case
'B'
:
{
{
const
char
*
value
;
const
char
*
value
;
int
len
;
if
(
p
[
1
]
==
0
&&
i
+
1
==
argc
)
if
(
p
[
1
]
==
0
&&
i
+
1
==
argc
)
fatal
(
"argument to `-B' is missing"
);
fatal
(
"argument to `-B' is missing"
);
if
(
p
[
1
]
==
0
)
if
(
p
[
1
]
==
0
)
value
=
argv
[
++
i
];
value
=
argv
[
++
i
];
else
else
value
=
p
+
1
;
value
=
p
+
1
;
{
/* As a kludge, if the arg is "[foo/]stageN/", just
len
=
strlen
(
value
);
add "[foo/]include" to the include prefix. */
int
len
=
strlen
(
value
);
/* Catch the case where the user has forgotten to append a
if
((
len
==
7
directory seperator to the path. Note, they may be using
||
(
len
>
7
-B to add an executable name prefix, eg "i386-elf-", in
&&
(
IS_DIR_SEPARATOR
(
value
[
len
-
8
]))))
order to distinguish between multiple installations of
&&
strncmp
(
value
+
len
-
7
,
"stage"
,
5
)
==
0
GCC in the same directory. Hence we must check to see
&&
ISDIGIT
(
value
[
len
-
2
])
if appending a directory separator actually makes a
&&
(
IS_DIR_SEPARATOR
(
value
[
len
-
1
])))
valid directory name. */
{
if
(
!
IS_DIR_SEPARATOR
(
value
[
len
-
1
])
if
(
len
==
7
)
&&
is_directory
(
value
,
""
,
0
))
add_prefix
(
&
include_prefixes
,
"include"
,
NULL
,
{
value
=
strcpy
(
xmalloc
(
len
+
2
),
value
);
value
[
len
]
=
DIR_SEPARATOR
;
value
[
++
len
]
=
0
;
}
/* As a kludge, if the arg is "[foo/]stageN/", just
add "[foo/]include" to the include prefix. */
if
((
len
==
7
||
(
len
>
7
&&
(
IS_DIR_SEPARATOR
(
value
[
len
-
8
]))))
&&
strncmp
(
value
+
len
-
7
,
"stage"
,
5
)
==
0
&&
ISDIGIT
(
value
[
len
-
2
])
&&
(
IS_DIR_SEPARATOR
(
value
[
len
-
1
])))
{
if
(
len
==
7
)
add_prefix
(
&
include_prefixes
,
"include"
,
NULL
,
PREFIX_PRIORITY_B_OPT
,
0
,
NULL
);
else
{
char
*
string
=
xmalloc
(
len
+
1
);
strncpy
(
string
,
value
,
len
-
7
);
strcpy
(
string
+
len
-
7
,
"include"
);
add_prefix
(
&
include_prefixes
,
string
,
NULL
,
PREFIX_PRIORITY_B_OPT
,
0
,
NULL
);
PREFIX_PRIORITY_B_OPT
,
0
,
NULL
);
else
}
{
}
char
*
string
=
xmalloc
(
len
+
1
);
strncpy
(
string
,
value
,
len
-
7
);
strcpy
(
string
+
len
-
7
,
"include"
);
add_prefix
(
&
include_prefixes
,
string
,
NULL
,
PREFIX_PRIORITY_B_OPT
,
0
,
NULL
);
}
}
}
add_prefix
(
&
exec_prefixes
,
value
,
NULL
,
add_prefix
(
&
exec_prefixes
,
value
,
NULL
,
PREFIX_PRIORITY_B_OPT
,
0
,
&
warn_B
);
PREFIX_PRIORITY_B_OPT
,
0
,
&
warn_B
);
add_prefix
(
&
startfile_prefixes
,
value
,
NULL
,
add_prefix
(
&
startfile_prefixes
,
value
,
NULL
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment