Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
e982ecac
Commit
e982ecac
authored
Mar 10, 2013
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/ld: add tmpdir flag to preserve temp files
R=ken2 CC=golang-dev
https://golang.org/cl/7497044
parent
433824d8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
9 deletions
+11
-9
obj.c
src/cmd/5l/obj.c
+1
-0
obj.c
src/cmd/6l/obj.c
+2
-1
obj.c
src/cmd/8l/obj.c
+1
-0
lib.c
src/cmd/ld/lib.c
+5
-6
lib.h
src/cmd/ld/lib.h
+2
-2
No files found.
src/cmd/5l/obj.c
View file @
e982ecac
...
...
@@ -123,6 +123,7 @@ main(int argc, char *argv[])
flagstr
(
"r"
,
"dir1:dir2:...: set ELF dynamic linker search path"
,
&
rpath
);
flagcount
(
"race"
,
"enable race detector"
,
&
flag_race
);
flagcount
(
"s"
,
"disable symbol table"
,
&
debug
[
's'
]);
flagstr
(
"tmpdir"
,
"leave temporary files in this directory"
,
&
tmpdir
);
flagcount
(
"u"
,
"reject unsafe packages"
,
&
debug
[
'u'
]);
flagcount
(
"v"
,
"print link trace"
,
&
debug
[
'v'
]);
flagcount
(
"w"
,
"disable DWARF generation"
,
&
debug
[
'w'
]);
...
...
src/cmd/6l/obj.c
View file @
e982ecac
...
...
@@ -117,10 +117,11 @@ main(int argc, char *argv[])
flagstr
(
"r"
,
"dir1:dir2:...: set ELF dynamic linker search path"
,
&
rpath
);
flagcount
(
"race"
,
"enable race detector"
,
&
flag_race
);
flagcount
(
"s"
,
"disable symbol table"
,
&
debug
[
's'
]);
flagcount
(
"shared"
,
"generate shared object"
,
&
flag_shared
);
flagstr
(
"tmpdir"
,
"leave temporary files in this directory"
,
&
tmpdir
);
flagcount
(
"u"
,
"reject unsafe packages"
,
&
debug
[
'u'
]);
flagcount
(
"v"
,
"print link trace"
,
&
debug
[
'v'
]);
flagcount
(
"w"
,
"disable DWARF generation"
,
&
debug
[
'w'
]);
flagcount
(
"shared"
,
"generate shared object"
,
&
flag_shared
);
flagparse
(
&
argc
,
&
argv
,
usage
);
...
...
src/cmd/8l/obj.c
View file @
e982ecac
...
...
@@ -123,6 +123,7 @@ main(int argc, char *argv[])
flagcount
(
"race"
,
"enable race detector"
,
&
flag_race
);
flagcount
(
"s"
,
"disable symbol table"
,
&
debug
[
's'
]);
flagcount
(
"n"
,
"dump symbol table"
,
&
debug
[
'n'
]);
flagstr
(
"tmpdir"
,
"leave temporary files in this directory"
,
&
tmpdir
);
flagcount
(
"u"
,
"reject unsafe packages"
,
&
debug
[
'u'
]);
flagcount
(
"v"
,
"print link trace"
,
&
debug
[
'v'
]);
flagcount
(
"w"
,
"disable DWARF generation"
,
&
debug
[
'w'
]);
...
...
src/cmd/ld/lib.c
View file @
e982ecac
...
...
@@ -557,8 +557,6 @@ hostobjs(void)
}
}
static
char
*
tmpdir
;
static
void
rmtemp
(
void
)
{
...
...
@@ -574,10 +572,11 @@ hostlinksetup(void)
return
;
// create temporary directory and arrange cleanup
// TODO: Add flag to specify tempdir, which is then not cleaned up.
tmpdir
=
mktempdir
();
atexit
(
rmtemp
);
if
(
tmpdir
==
nil
)
{
tmpdir
=
mktempdir
();
atexit
(
rmtemp
);
}
// change our output to temporary object file
close
(
cout
);
p
=
smprint
(
"%s/go.o"
,
tmpdir
);
...
...
src/cmd/ld/lib.h
View file @
e982ecac
...
...
@@ -148,6 +148,7 @@ EXTERN int flag_race;
EXTERN
int
flag_shared
;
EXTERN
char
*
tracksym
;
EXTERN
char
*
interpreter
;
EXTERN
char
*
tmpdir
;
enum
{
...
...
@@ -166,8 +167,7 @@ enum
EXTERN
Segment
segtext
;
EXTERN
Segment
segdata
;
EXTERN
Segment
segsym
;
EXTERN
Segment
segdwarf
;
EXTERN
Segment
segdwarf
;
void
addlib
(
char
*
src
,
char
*
obj
);
void
addlibpath
(
char
*
srcref
,
char
*
objref
,
char
*
file
,
char
*
pkg
);
...
...
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