code review 11201043: misc/cgo/test: make test work with -linkmode=internal (issue 11201043)

24 views
Skip to first unread message

r...@golang.org

unread,
Jul 11, 2013, 11:24:18 PM7/11/13
to minu...@gmail.com, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
Reviewers: minux,

Message:
Hello minu...@gmail.com (cc: golan...@googlegroups.com),

I'd like you to review this change to
https://code.google.com/p/go/


Description:
misc/cgo/test: make test work with -linkmode=internal

The static func named thread in issue5337.go's C snippet
conflicts with the static func named thread in issue3350.go's C snippet.
I don't know why (they're both static) but I also don't care,
because -linkmode=internal only needs to be able to handle
the cgo in the standard library, and it does.

Change the test to avoid this problem.

Fixes build (after run.bash is fixed to detect the breakage).

Please review this at https://codereview.appspot.com/11201043/

Affected files:
M misc/cgo/test/issue5337.go


Index: misc/cgo/test/issue5337.go
===================================================================
--- a/misc/cgo/test/issue5337.go
+++ b/misc/cgo/test/issue5337.go
@@ -10,14 +10,14 @@
#include <signal.h>
#include <pthread.h>

-static void *thread(void *p) {
+static void *thread1(void *p) {
(void)p;
pthread_kill(pthread_self(), SIGPROF);
return NULL;
}
void test5337() {
pthread_t tid;
- pthread_create(&tid, 0, thread, NULL);
+ pthread_create(&tid, 0, thread1, NULL);
pthread_join(tid, 0);
}
*/


r...@golang.org

unread,
Jul 11, 2013, 11:24:38 PM7/11/13
to r...@golang.org, minu...@gmail.com, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
*** Submitted as
https://code.google.com/p/go/source/detail?r=49f08e8cd312 ***

misc/cgo/test: make test work with -linkmode=internal

The static func named thread in issue5337.go's C snippet
conflicts with the static func named thread in issue3350.go's C snippet.
I don't know why (they're both static) but I also don't care,
because -linkmode=internal only needs to be able to handle
the cgo in the standard library, and it does.

Change the test to avoid this problem.

Fixes build (after run.bash is fixed to detect the breakage).

R=minux.ma
TBR=minux.ma
CC=golang-dev
https://codereview.appspot.com/11201043


https://codereview.appspot.com/11201043/

minux

unread,
Jul 12, 2013, 12:28:53 AM7/12/13
to r...@golang.org, minu...@gmail.com, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
LGTM.

In fact, i've mailed out a CL to fix this problem on Darwin and Windows:
Reply all
Reply to author
Forward
0 new messages