Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(928)

Issue 80300043: code review 80300043: cmd/go: ensure external test files are presented to the... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 1 month ago by dave
Modified:
10 years, 1 month ago
Reviewers:
iant
CC:
rsc, iant, golang-codereviews, mwhudson
Visibility:
Public.

Description

cmd/go: ensure external test files are presented to the linker first Fixes issue 7627. CL 61970044 changed the order in which .a files are passed to gccgo's link phase. However by reversing the order it caused gccgo to complain if both internal (liba.a) and external (liba_test.a) versions of a package were presented as the former would not contain all the necessary symbols, and the latter would duplicate symbols already defined. This change ensures that all 'fake' targets remain at the top of the final link order which should be fine as a package compiled as an external test is a superset of its internal sibling. Looking at how gcToolchain links tests I think this change now accurately mirrors those actions which present $WORK/_test before $WORK in the link order.

Patch Set 1 #

Patch Set 2 : diff -r 61133dcaba23 https://code.google.com/p/go #

Patch Set 3 : diff -r 61133dcaba23 https://code.google.com/p/go #

Patch Set 4 : diff -r c73c7a9c5916 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -1 line) Patch
M src/cmd/go/build.go View 1 1 chunk +6 lines, -1 line 0 comments Download

Messages

Total messages: 3
dave_cheney.net
Hello rsc@golang.org, iant@golang.org (cc: golang-codereviews@googlegroups.com, michael.hudson@linaro.org), I'd like you to review this change to https://code.google.com/p/go
10 years, 1 month ago (2014-03-26 02:41:49 UTC) #1
iant
LGTM I guess the dependency order doesn't matter here, since all the libraries are passed ...
10 years, 1 month ago (2014-03-26 03:36:55 UTC) #2
dave_cheney.net
10 years, 1 month ago (2014-03-26 04:31:10 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=17d7877c66d4 ***

cmd/go: ensure external test files are presented to the linker first

Fixes issue 7627.

CL 61970044 changed the order in which .a files are passed to gccgo's link
phase. However by reversing the order it caused gccgo to complain if both
internal (liba.a) and external (liba_test.a) versions of a package were
presented as the former would not contain all the necessary symbols, and the
latter would duplicate symbols already defined.

This change ensures that all 'fake' targets remain at the top of the final link
order which should be fine as a package compiled as an external test is a
superset of its internal sibling.

Looking at how gcToolchain links tests I think this change now accurately
mirrors those actions which present $WORK/_test before $WORK in the link order.

LGTM=iant
R=rsc, iant
CC=golang-codereviews, michael.hudson
https://codereview.appspot.com/80300043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b