Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
63a84348
Commit
63a84348
authored
Nov 19, 2008
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
look for .6 before .a; accept archives with 0 length __.SYMDEF
TBR=r OCL=19612 CL=19612
parent
b548e734
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
src/cmd/gc/lex.c
src/cmd/gc/lex.c
+14
-9
No files found.
src/cmd/gc/lex.c
View file @
63a84348
...
...
@@ -135,15 +135,16 @@ setfilename(char *file)
}
int
arsize
(
Biobuf
*
b
,
char
*
name
){
arsize
(
Biobuf
*
b
,
char
*
name
)
{
struct
ar_hdr
*
a
;
if
((
a
=
Brdline
(
b
,
'\n'
))
==
nil
)
return
0
;
return
-
1
;
if
(
Blinelen
(
b
)
!=
sizeof
(
struct
ar_hdr
))
return
0
;
return
-
1
;
if
(
strncmp
(
a
->
name
,
name
,
strlen
(
name
))
!=
0
)
return
0
;
return
-
1
;
return
atoi
(
a
->
size
);
}
...
...
@@ -162,7 +163,7 @@ skiptopkgdef(Biobuf *b)
return
0
;
/* symbol table is first; skip it */
sz
=
arsize
(
b
,
"__.SYMDEF"
);
if
(
sz
<
=
0
)
if
(
sz
<
0
)
return
0
;
Bseek
(
b
,
sz
,
1
);
/* package export block is second */
...
...
@@ -184,16 +185,20 @@ findpkg(String *name)
}
// BOTCH need to get .6 from backend
snprint
(
namebuf
,
sizeof
(
namebuf
),
"%Z.6"
,
name
);
if
(
access
(
namebuf
,
0
)
>=
0
)
return
1
;
// try .a before .6. important for building libraries:
// if there is an array.6 in the array.a library,
// want to find all of array.a, not just array.6.
snprint
(
namebuf
,
sizeof
(
namebuf
),
"%Z.a"
,
name
);
if
(
access
(
namebuf
,
0
)
>=
0
)
return
1
;
snprint
(
namebuf
,
sizeof
(
namebuf
),
"%
s/pkg/%Z.6"
,
goroot
,
name
);
snprint
(
namebuf
,
sizeof
(
namebuf
),
"%
Z.6"
,
name
);
if
(
access
(
namebuf
,
0
)
>=
0
)
return
1
;
snprint
(
namebuf
,
sizeof
(
namebuf
),
"%s/pkg/%Z.a"
,
goroot
,
name
);
if
(
access
(
namebuf
,
0
)
>=
0
)
return
1
;
snprint
(
namebuf
,
sizeof
(
namebuf
),
"%s/pkg/%Z.6"
,
goroot
,
name
);
if
(
access
(
namebuf
,
0
)
>=
0
)
return
1
;
return
0
;
...
...
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