This patch to libgo uses the new -fgo-pkgpath option when building libgo. This produces a standard library that uses the same type reflection strings and PkgPath information as the other Go library. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline and 4.7 branch.
Ian
diff -r af87954a9464 go/unsafe.cc --- a/go/unsafe.cc Thu May 10 22:25:00 2012 -0700 +++ b/go/unsafe.cc Mon May 14 14:50:05 2012 -0700 @@ -22,8 +22,8 @@ bool add_to_globals; Package* package = this->add_imported_package("unsafe", local_name, is_local_name_exported, - "libgo_unsafe.unsafe", - location, &add_to_globals); + "unsafe", location, + &add_to_globals); if (package == NULL) { diff -r af87954a9464 libgo/Makefile.am --- a/libgo/Makefile.am Thu May 10 22:25:00 2012 -0700 +++ b/libgo/Makefile.am Mon May 14 14:50:05 2012 -0700 @@ -488,31 +488,31 @@ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $< malloc.c: $(srcdir)/runtime/malloc.goc goc2c - ./goc2c --gcc --go-prefix libgo_runtime $< > $@.tmp + ./goc2c --gcc $< > $@.tmp mv -f $@.tmp $@ mprof.c: $(srcdir)/runtime/mprof.goc goc2c - ./goc2c --gcc --go-prefix libgo_runtime $< > $@.tmp + ./goc2c --gcc $< > $@.tmp mv -f $@.tmp $@ reflect.c: $(srcdir)/runtime/reflect.goc goc2c - ./goc2c --gcc --go-prefix libgo_reflect $< > $@.tmp + ./goc2c --gcc $< > $@.tmp mv -f $@.tmp $@ runtime1.c: $(srcdir)/runtime/runtime1.goc goc2c - ./goc2c --gcc --go-prefix libgo_runtime $< > $@.tmp + ./goc2c --gcc $< > $@.tmp mv -f $@.tmp $@ sema.c: $(srcdir)/runtime/sema.goc goc2c - ./goc2c --gcc --go-prefix libgo_sync $< > $@.tmp + ./goc2c --gcc $< > $@.tmp mv -f $@.tmp $@ sigqueue.c: $(srcdir)/runtime/sigqueue.goc goc2c - ./goc2c --gcc --go-prefix libgo_os $< > $@.tmp + ./goc2c --gcc --go-pkgpath os_signal $< > $@.tmp mv -f $@.tmp $@ time.c: $(srcdir)/runtime/time.goc goc2c - ./goc2c --gcc --go-prefix libgo_time $< > $@.tmp + ./goc2c --gcc $< > $@.tmp mv -f $@.tmp $@ %.c: $(srcdir)/runtime/%.goc goc2c @@ -1604,33 +1604,38 @@ endif libgo_go_objs = \ - bufio/bufio.lo \ - bytes/bytes.lo \ + bufio.lo \ + bytes.lo \ bytes/index.lo \ - crypto/crypto.lo \ - errors/errors.lo \ - expvar/expvar.lo \ - flag/flag.lo \ - fmt/fmt.lo \ - hash/hash.lo \ - html/html.lo \ - image/image.lo \ - io/io.lo \ - log/log.lo \ - math/math.lo \ - net/net.lo \ - os/exec.lo \ - os/os.lo \ - path/path.lo \ - reflect/reflect.lo \ - regexp/regexp.lo \ - runtime/runtime.lo \ - sort/sort.lo \ - strconv/strconv.lo \ - strings/strings.lo \ - sync/sync.lo \ - time/time.lo \ - unicode/unicode.lo \ + crypto.lo \ + errors.lo \ + expvar.lo \ + flag.lo \ + fmt.lo \ + hash.lo \ + html.lo \ + image.lo \ + io.lo \ + log.lo \ + math.lo \ + mime.lo \ + net.lo \ + os.lo \ + path.lo \ + reflect-go.lo \ + regexp.lo \ + runtime-go.lo \ + sort.lo \ + strconv.lo \ + strings.lo \ + sync.lo \ + syscall.lo \ + syscall/errno.lo \ + syscall/signame.lo \ + syscall/wait.lo \ + testing.lo \ + time-go.lo \ + unicode.lo \ archive/tar.lo \ archive/zip.lo \ compress/bzip2.lo \ @@ -1713,7 +1718,6 @@ math/big.lo \ math/cmplx.lo \ math/rand.lo \ - mime/mime.lo \ mime/multipart.lo \ net/http.lo \ net/mail.lo \ @@ -1724,6 +1728,7 @@ old/netchan.lo \ old/regexp.lo \ old/template.lo \ + os/exec.lo \ $(os_lib_inotify_lo) \ os/signal.lo \ os/user.lo \ @@ -1734,15 +1739,10 @@ runtime/pprof.lo \ sync/atomic.lo \ sync/atomic_c.lo \ - syscall/syscall.lo \ - syscall/errno.lo \ - syscall/signame.lo \ - syscall/wait.lo \ text/scanner.lo \ text/tabwriter.lo \ text/template.lo \ text/template/parse.lo \ - testing/testing.lo \ testing/iotest.lo \ testing/quick.lo \ unicode/utf16.lo \ @@ -1780,7 +1780,7 @@ BUILDPACKAGE = \ $(MKDIR_P) $(@D); \ files=`echo $^ | sed -e 's/[^ ]*\.gox//g'`; \ - $(LTGOCOMPILE) -I . -c -fgo-prefix="libgo_$(@D)" -o $@ $$files + $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//' -e 's/-go$$//'` -o $@ $$files if LIBGO_IS_RTEMS use_dejagnu = yes @@ -1805,12 +1805,10 @@ LD_LIBRARY_PATH=`echo $${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \ export LD_LIBRARY_PATH; \ rm -f $@-testsum $@-testlog; \ - prefix=`if test "$(@D)" = "regexp"; then echo regexp-test; else dirname $(@D); fi`; \ - test "$${prefix}" != "." || prefix="$(@D)"; \ if test "$(use_dejagnu)" = "yes"; then \ - $(SHELL) $(srcdir)/testsuite/gotest --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" --testname="$(@D)" --goarch="$(GOARCH)" $(GOTESTFLAGS); \ + $(SHELL) $(srcdir)/testsuite/gotest --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" --testname="$(@D)" --goarch="$(GOARCH)" $(GOTESTFLAGS); \ else \ - if $(SHELL) $(srcdir)/testsuite/gotest --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" --goarch="$(GOARCH)" $(GOTESTFLAGS) >>$@-testlog 2>&1; then \ + if $(SHELL) $(srcdir)/testsuite/gotest --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" --goarch="$(GOARCH)" $(GOTESTFLAGS) >>$@-testlog 2>&1; then \ echo "PASS: $(@D)" >> $@-testlog; \ echo "PASS: $(@D)"; \ echo "PASS: $(@D)" > $@-testsum; \ @@ -1852,258 +1850,249 @@ $(toolexeclibgotexttemplate_DATA) \ $(toolexeclibgounicode_DATA) -@go_include@ bufio/bufio.lo.dep -bufio/bufio.lo.dep: $(go_bufio_files) +@go_include@ bufio.lo.dep +bufio.lo.dep: $(go_bufio_files) $(BUILDDEPS) -bufio/bufio.lo: $(go_bufio_files) +bufio.lo: $(go_bufio_files) $(BUILDPACKAGE) bufio/check: $(CHECK_DEPS) @$(CHECK) .PHONY: bufio/check -@go_include@ bytes/bytes.lo.dep -bytes/bytes.lo.dep: $(go_bytes_files) +@go_include@ bytes.lo.dep +bytes.lo.dep: $(go_bytes_files) $(BUILDDEPS) -bytes/bytes.lo: $(go_bytes_files) +bytes.lo: $(go_bytes_files) $(BUILDPACKAGE) -bytes/index.lo: $(go_bytes_c_files) bytes/bytes.lo +bytes/index.lo: $(go_bytes_c_files) + @$(MKDIR_P) bytes $(LTCOMPILE) -c -o bytes/index.lo $(srcdir)/go/bytes/indexbyte.c bytes/check: $(CHECK_DEPS) @$(CHECK) .PHONY: bytes/check -@go_include@ crypto/crypto.lo.dep -crypto/crypto.lo.dep: $(go_crypto_files) +@go_include@ crypto.lo.dep +crypto.lo.dep: $(go_crypto_files) $(BUILDDEPS) -crypto/crypto.lo: $(go_crypto_files) +crypto.lo: $(go_crypto_files) $(BUILDPACKAGE) crypto/check: $(CHECK_DEPS) @$(CHECK) .PHONY: crypto/check -@go_include@ errors/errors.lo.dep -errors/errors.lo.dep: $(go_errors_files) +@go_include@ errors.lo.dep +errors.lo.dep: $(go_errors_files) $(BUILDDEPS) -errors/errors.lo: $(go_errors_files) +errors.lo: $(go_errors_files) $(BUILDPACKAGE) errors/check: $(CHECK_DEPS) @$(CHECK) .PHONY: errors/check -@go_include@ expvar/expvar.lo.dep -expvar/expvar.lo.dep: $(go_expvar_files) +@go_include@ expvar.lo.dep +expvar.lo.dep: $(go_expvar_files) $(BUILDDEPS) -expvar/expvar.lo: $(go_expvar_files) +expvar.lo: $(go_expvar_files) $(BUILDPACKAGE) expvar/check: $(CHECK_DEPS) @$(CHECK) .PHONY: expvar/check -@go_include@ flag/flag.lo.dep -flag/flag.lo.dep: $(go_flag_files) +@go_include@ flag.lo.dep +flag.lo.dep: $(go_flag_files) $(BUILDDEPS) -flag/flag.lo: $(go_flag_files) +flag.lo: $(go_flag_files) $(BUILDPACKAGE) flag/check: $(CHECK_DEPS) @$(CHECK) .PHONY: flag/check -@go_include@ fmt/fmt.lo.dep -fmt/fmt.lo.dep: $(go_fmt_files) +@go_include@ fmt.lo.dep +fmt.lo.dep: $(go_fmt_files) $(BUILDDEPS) -fmt/fmt.lo: $(go_fmt_files) +fmt.lo: $(go_fmt_files) $(BUILDPACKAGE) fmt/check: $(CHECK_DEPS) @$(CHECK) .PHONY: fmt/check -@go_include@ hash/hash.lo.dep -hash/hash.lo.dep: $(go_hash_files) +@go_include@ hash.lo.dep +hash.lo.dep: $(go_hash_files) $(BUILDDEPS) -hash/hash.lo: $(go_hash_files) +hash.lo: $(go_hash_files) $(BUILDPACKAGE) hash/check: $(CHECK_DEPS) @$(CHECK) .PHONY: hash/check -@go_include@ html/html.lo.dep -html/html.lo.dep: $(go_html_files) +@go_include@ html.lo.dep +html.lo.dep: $(go_html_files) $(BUILDDEPS) -html/html.lo: $(go_html_files) +html.lo: $(go_html_files) $(BUILDPACKAGE) html/check: $(CHECK_DEPS) @$(CHECK) .PHONY: html/check -@go_include@ image/image.lo.dep -image/image.lo.dep: $(go_image_files) +@go_include@ image.lo.dep +image.lo.dep: $(go_image_files) $(BUILDDEPS) -image/image.lo: $(go_image_files) +image.lo: $(go_image_files) $(BUILDPACKAGE) image/check: $(CHECK_DEPS) @$(CHECK) .PHONY: image/check -@go_include@ io/io.lo.dep -io/io.lo.dep: $(go_io_files) +@go_include@ io.lo.dep +io.lo.dep: $(go_io_files) $(BUILDDEPS) -io/io.lo: $(go_io_files) +io.lo: $(go_io_files) $(BUILDPACKAGE) io/check: $(CHECK_DEPS) @$(CHECK) .PHONY: io/check -@go_include@ log/log.lo.dep -log/log.lo.dep: $(go_log_files) +@go_include@ log.lo.dep +log.lo.dep: $(go_log_files) $(BUILDDEPS) -log/log.lo: $(go_log_files) +log.lo: $(go_log_files) $(BUILDPACKAGE) log/check: $(CHECK_DEPS) @$(CHECK) .PHONY: log/check -@go_include@ math/math.lo.dep -math/math.lo.dep: $(go_math_files) +@go_include@ math.lo.dep +math.lo.dep: $(go_math_files) $(BUILDDEPS) -math/math.lo: $(go_math_files) +math.lo: $(go_math_files) $(MKDIR_P) $(@D) files=`echo $^ | sed -e 's/[^ ]*\.gox//g'`; \ - $(LTGOCOMPILE) $(MATH_FLAG) -I . -c -fgo-prefix="libgo_$(@D)" -o $@ $$files + $(LTGOCOMPILE) $(MATH_FLAG) -I . -c -fgo-pkgpath=math -o $@ $$files math/check: $(CHECK_DEPS) @$(CHECK) .PHONY: math/check -@go_include@ mime/mime.lo.dep -mime/mime.lo.dep: $(go_mime_files) +@go_include@ mime.lo.dep +mime.lo.dep: $(go_mime_files) $(BUILDDEPS) -mime/mime.lo: $(go_mime_files) +mime.lo: $(go_mime_files) $(BUILDPACKAGE) mime/check: $(CHECK_DEPS) @$(CHECK) .PHONY: mime/check -@go_include@ net/net.lo.dep -net/net.lo.dep: $(go_net_files) +@go_include@ net.lo.dep +net.lo.dep: $(go_net_files) $(BUILDDEPS) -net/net.lo: $(go_net_files) +net.lo: $(go_net_files) $(BUILDPACKAGE) net/check: $(CHECK_DEPS) @$(CHECK) .PHONY: net/check -@go_include@ os/os.lo.dep -os/os.lo.dep: $(go_os_files) +@go_include@ os.lo.dep +os.lo.dep: $(go_os_files) $(BUILDDEPS) -os/os.lo: $(go_os_files) +os.lo: $(go_os_files) $(BUILDPACKAGE) os/check: $(CHECK_DEPS) @$(CHECK) .PHONY: os/check -@go_include@ path/path.lo.dep -path/path.lo.dep: $(go_path_files) +@go_include@ path.lo.dep +path.lo.dep: $(go_path_files) $(BUILDDEPS) -path/path.lo: $(go_path_files) +path.lo: $(go_path_files) $(BUILDPACKAGE) path/check: $(CHECK_DEPS) @$(CHECK) .PHONY: path/check -@go_include@ reflect/reflect.lo.dep -reflect/reflect.lo.dep: $(go_reflect_files) +@go_include@ reflect-go.lo.dep +reflect-go.lo.dep: $(go_reflect_files) $(BUILDDEPS) -reflect/reflect.lo: $(go_reflect_files) +reflect-go.lo: $(go_reflect_files) $(BUILDPACKAGE) reflect/check: $(CHECK_DEPS) @$(CHECK) .PHONY: reflect/check -@go_include@ regexp/regexp.lo.dep -regexp/regexp.lo.dep: $(go_regexp_files) +@go_include@ regexp.lo.dep +regexp.lo.dep: $(go_regexp_files) $(BUILDDEPS) -regexp/regexp.lo: $(go_regexp_files) +regexp.lo: $(go_regexp_files) $(BUILDPACKAGE) regexp/check: $(CHECK_DEPS) @$(CHECK) .PHONY: regexp/check -@go_include@ runtime/runtime.lo.dep -runtime/runtime.lo.dep: $(go_runtime_files) +@go_include@ runtime-go.lo.dep +runtime-go.lo.dep: $(go_runtime_files) $(BUILDDEPS) -runtime/runtime.lo: $(go_runtime_files) +runtime-go.lo: $(go_runtime_files) $(BUILDPACKAGE) runtime/check: $(CHECK_DEPS) @$(CHECK) .PHONY: runtime/check -@go_include@ text/scanner.lo.dep -text/scanner.lo.dep: $(go_text_scanner_files) +@go_include@ sort.lo.dep +sort.lo.dep: $(go_sort_files) $(BUILDDEPS) -text/scanner.lo: $(go_text_scanner_files) - $(BUILDPACKAGE) -text/scanner/check: $(CHECK_DEPS) - @$(MKDIR_P) text/scanner - @$(CHECK) -.PHONY: text/scanner/check - -@go_include@ sort/sort.lo.dep -sort/sort.lo.dep: $(go_sort_files) - $(BUILDDEPS) -sort/sort.lo: $(go_sort_files) +sort.lo: $(go_sort_files) $(BUILDPACKAGE) sort/check: $(CHECK_DEPS) @$(CHECK) .PHONY: sort/check -@go_include@ strconv/strconv.lo.dep -strconv/strconv.lo.dep: $(go_strconv_files) +@go_include@ strconv.lo.dep +strconv.lo.dep: $(go_strconv_files) $(BUILDDEPS) -strconv/strconv.lo: $(go_strconv_files) +strconv.lo: $(go_strconv_files) $(BUILDPACKAGE) strconv/check: $(CHECK_DEPS) @$(CHECK) .PHONY: strconv/check -@go_include@ strings/strings.lo.dep -strings/strings.lo.dep: $(go_strings_files) +@go_include@ strings.lo.dep +strings.lo.dep: $(go_strings_files) $(BUILDDEPS) -strings/strings.lo: $(go_strings_files) +strings.lo: $(go_strings_files) $(BUILDPACKAGE) strings/check: $(CHECK_DEPS) @$(CHECK) .PHONY: strings/check -@go_include@ sync/sync.lo.dep -sync/sync.lo.dep: $(go_sync_files) +@go_include@ sync.lo.dep +sync.lo.dep: $(go_sync_files) $(BUILDDEPS) -sync/sync.lo: $(go_sync_files) +sync.lo: $(go_sync_files) $(BUILDPACKAGE) sync/check: $(CHECK_DEPS) @$(CHECK) .PHONY: sync/check -@go_include@ testing/testing.lo.dep -testing/testing.lo.dep: $(go_testing_files) +@go_include@ testing.lo.dep +testing.lo.dep: $(go_testing_files) $(BUILDDEPS) -testing/testing.lo: $(go_testing_files) +testing.lo: $(go_testing_files) $(BUILDPACKAGE) testing/check: $(CHECK_DEPS) @$(CHECK) .PHONY: testing/check -@go_include@ time/time.lo.dep -time/time.lo.dep: $(go_time_files) +@go_include@ time-go.lo.dep +time-go.lo.dep: $(go_time_files) $(BUILDDEPS) -time/time.lo: $(go_time_files) +time-go.lo: $(go_time_files) $(BUILDPACKAGE) time/check: $(CHECK_DEPS) @$(CHECK) .PHONY: time/check -@go_include@ unicode/unicode.lo.dep -unicode/unicode.lo.dep: $(go_unicode_files) +@go_include@ unicode.lo.dep +unicode.lo.dep: $(go_unicode_files) $(BUILDDEPS) -unicode/unicode.lo: $(go_unicode_files) +unicode.lo: $(go_unicode_files) $(BUILDPACKAGE) unicode/check: $(CHECK_DEPS) @$(CHECK) @@ -3133,6 +3122,16 @@ @$(CHECK) .PHONY: sync/atomic/check +@go_include@ text/scanner.lo.dep +text/scanner.lo.dep: $(go_text_scanner_files) + $(BUILDDEPS) +text/scanner.lo: $(go_text_scanner_files) + $(BUILDPACKAGE) +text/scanner/check: $(CHECK_DEPS) + @$(MKDIR_P) text/scanner + @$(CHECK) +.PHONY: text/scanner/check + @go_include@ text/tabwriter.lo.dep text/tabwriter.lo.dep: $(go_text_tabwriter_files) $(BUILDDEPS) @@ -3202,16 +3201,19 @@ @$(CHECK) .PHONY: unicode/utf8/check -@go_include@ syscall/syscall.lo.dep -syscall/syscall.lo.dep: $(go_syscall_files) +@go_include@ syscall.lo.dep +syscall.lo.dep: $(go_syscall_files) $(BUILDDEPS) -syscall/syscall.lo: $(go_syscall_files) +syscall.lo: $(go_syscall_files) $(BUILDPACKAGE) syscall/errno.lo: go/syscall/errno.c + @$(MKDIR_P) syscall $(LTCOMPILE) -c -o $@ $< syscall/signame.lo: go/syscall/signame.c + @$(MKDIR_P) syscall $(LTCOMPILE) -c -o $@ $< syscall/wait.lo: go/syscall/wait.c + @$(MKDIR_P) syscall $(LTCOMPILE) -c -o $@ $< # How to build a .gox file from a .lo file. @@ -3219,61 +3221,61 @@ f=`echo $< | sed -e 's/.lo$$/.o/'`; \ $(OBJCOPY) -j .go_export $$f $@.tmp && mv -f $@.tmp $@ -bufio.gox: bufio/bufio.lo +bufio.gox: bufio.lo $(BUILDGOX) -bytes.gox: bytes/bytes.lo +bytes.gox: bytes.lo $(BUILDGOX) -crypto.gox: crypto/crypto.lo +crypto.gox: crypto.lo $(BUILDGOX) -errors.gox: errors/errors.lo +errors.gox: errors.lo $(BUILDGOX) -expvar.gox: expvar/expvar.lo +expvar.gox: expvar.lo $(BUILDGOX) -flag.gox: flag/flag.lo +flag.gox: flag.lo $(BUILDGOX) -fmt.gox: fmt/fmt.lo +fmt.gox: fmt.lo $(BUILDGOX) -hash.gox: hash/hash.lo +hash.gox: hash.lo $(BUILDGOX) -html.gox: html/html.lo +html.gox: html.lo $(BUILDGOX) -image.gox: image/image.lo +image.gox: image.lo $(BUILDGOX) -io.gox: io/io.lo +io.gox: io.lo $(BUILDGOX) -log.gox: log/log.lo +log.gox: log.lo $(BUILDGOX) -math.gox: math/math.lo +math.gox: math.lo $(BUILDGOX) -mime.gox: mime/mime.lo +mime.gox: mime.lo $(BUILDGOX) -net.gox: net/net.lo +net.gox: net.lo $(BUILDGOX) -os.gox: os/os.lo +os.gox: os.lo $(BUILDGOX) -path.gox: path/path.lo +path.gox: path.lo $(BUILDGOX) -reflect.gox: reflect/reflect.lo +reflect.gox: reflect-go.lo $(BUILDGOX) -regexp.gox: regexp/regexp.lo +regexp.gox: regexp.lo $(BUILDGOX) -runtime.gox: runtime/runtime.lo +runtime.gox: runtime-go.lo $(BUILDGOX) -sort.gox: sort/sort.lo +sort.gox: sort.lo $(BUILDGOX) -strconv.gox: strconv/strconv.lo +strconv.gox: strconv.lo $(BUILDGOX) -strings.gox: strings/strings.lo +strings.gox: strings.lo $(BUILDGOX) -sync.gox: sync/sync.lo +sync.gox: sync.lo $(BUILDGOX) -syscall.gox: syscall/syscall.lo +syscall.gox: syscall.lo $(BUILDGOX) -testing.gox: testing/testing.lo +testing.gox: testing.lo $(BUILDGOX) -time.gox: time/time.lo +time.gox: time-go.lo $(BUILDGOX) -unicode.gox: unicode/unicode.lo +unicode.gox: unicode.lo $(BUILDGOX) archive/tar.gox: archive/tar.lo diff -r af87954a9464 libgo/go/bytes/indexbyte.c --- a/libgo/go/bytes/indexbyte.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/go/bytes/indexbyte.c Mon May 14 14:50:05 2012 -0700 @@ -13,7 +13,7 @@ library function, which shouldn't need much stack space. */ int IndexByte (struct __go_open_array, char) - asm ("libgo_bytes.bytes.IndexByte") + asm ("bytes.IndexByte") __attribute__ ((no_split_stack)); int @@ -30,7 +30,7 @@ /* Comparison. */ _Bool Equal (struct __go_open_array a, struct __go_open_array b) - asm ("libgo_bytes.bytes.Equal") + asm ("bytes.Equal") __attribute__ ((no_split_stack)); _Bool diff -r af87954a9464 libgo/go/encoding/xml/marshal_test.go --- a/libgo/go/encoding/xml/marshal_test.go Thu May 10 22:25:00 2012 -0700 +++ b/libgo/go/encoding/xml/marshal_test.go Mon May 14 14:50:05 2012 -0700 @@ -726,7 +726,7 @@ }, { Value: map[*Ship]bool{nil: false}, - Err: "xml: unsupported type: map[*xml.Ship]bool", + Err: "xml: unsupported type: map[*encoding/xml.Ship]bool", Kind: reflect.Map, }, { diff -r af87954a9464 libgo/go/html/template/escape_test.go --- a/libgo/go/html/template/escape_test.go Thu May 10 22:25:00 2012 -0700 +++ b/libgo/go/html/template/escape_test.go Mon May 14 14:50:05 2012 -0700 @@ -226,7 +226,7 @@ { "badMarshaler", `<button onclick='alert(1/{{.B}}in numbers)'>`, - `<button onclick='alert(1/ /* json: error calling MarshalJSON for type *template.badMarshaler: invalid character 'f' looking for beginning of object key string */null in numbers)'>`, + `<button onclick='alert(1/ /* json: error calling MarshalJSON for type *html/template.badMarshaler: invalid character 'f' looking for beginning of object key string */null in numbers)'>`, }, { "jsMarshaler", diff -r af87954a9464 libgo/go/reflect/all_test.go --- a/libgo/go/reflect/all_test.go Thu May 10 22:25:00 2012 -0700 +++ b/libgo/go/reflect/all_test.go Mon May 14 14:50:05 2012 -0700 @@ -1383,7 +1383,7 @@ t Type path string }{ - {TypeOf(&base64.Encoding{}).Elem(), "libgo_encoding.base64"}, + {TypeOf(&base64.Encoding{}).Elem(), "encoding/base64"}, {TypeOf(uint(0)), ""}, {TypeOf(map[string]int{}), ""}, {TypeOf((*error)(nil)).Elem(), ""}, diff -r af87954a9464 libgo/go/regexp/all_test.go --- a/libgo/go/regexp/all_test.go Thu May 10 22:25:00 2012 -0700 +++ b/libgo/go/regexp/all_test.go Mon May 14 14:50:05 2012 -0700 @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package regexp +package regexp_test import ( + . "regexp" "strings" "testing" ) diff -r af87954a9464 libgo/go/regexp/exec_test.go --- a/libgo/go/regexp/exec_test.go Thu May 10 22:25:00 2012 -0700 +++ b/libgo/go/regexp/exec_test.go Mon May 14 14:50:05 2012 -0700 @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package regexp +package regexp_test import ( + . "regexp" "bufio" "compress/bzip2" "fmt" @@ -219,22 +220,22 @@ } func runFull(re, refull *Regexp, text string) ([]int, string) { - refull.longest = false + refull.SetLongest(false) return refull.FindStringSubmatchIndex(text), "[full]" } func runPartial(re, refull *Regexp, text string) ([]int, string) { - re.longest = false + re.SetLongest(false) return re.FindStringSubmatchIndex(text), "" } func runFullLongest(re, refull *Regexp, text string) ([]int, string) { - refull.longest = true + refull.SetLongest(true) return refull.FindStringSubmatchIndex(text), "[full,longest]" } func runPartialLongest(re, refull *Regexp, text string) ([]int, string) { - re.longest = true + re.SetLongest(true) return re.FindStringSubmatchIndex(text), "[longest]" } @@ -246,22 +247,22 @@ } func matchFull(re, refull *Regexp, text string) (bool, string) { - refull.longest = false + refull.SetLongest(false) return refull.MatchString(text), "[full]" } func matchPartial(re, refull *Regexp, text string) (bool, string) { - re.longest = false + re.SetLongest(false) return re.MatchString(text), "" } func matchFullLongest(re, refull *Regexp, text string) (bool, string) { - refull.longest = true + refull.SetLongest(true) return refull.MatchString(text), "[full,longest]" } func matchPartialLongest(re, refull *Regexp, text string) (bool, string) { - re.longest = true + re.SetLongest(true) return re.MatchString(text), "[longest]" } @@ -541,7 +542,7 @@ } } - re, err := compile(pattern, syn, true) + re, err := CompileInternal(pattern, syn, true) if err != nil { if shouldCompile { t.Errorf("%s:%d: %#q did not compile", file, lineno, pattern) diff -r af87954a9464 libgo/go/regexp/export_test.go --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgo/go/regexp/export_test.go Mon May 14 14:50:05 2012 -0700 @@ -0,0 +1,15 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package regexp + +import "regexp/syntax" + +func (re *Regexp) SetLongest(b bool) { + re.longest = b +} + +func CompileInternal(expr string, mode syntax.Flags, longest bool) (*Regexp, error) { + return compile(expr, mode, longest) +} diff -r af87954a9464 libgo/go/regexp/find_test.go --- a/libgo/go/regexp/find_test.go Thu May 10 22:25:00 2012 -0700 +++ b/libgo/go/regexp/find_test.go Mon May 14 14:50:05 2012 -0700 @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package regexp +package regexp_test import ( + . "regexp" "fmt" "strings" "testing" diff -r af87954a9464 libgo/go/sync/atomic/atomic.c --- a/libgo/go/sync/atomic/atomic.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/go/sync/atomic/atomic.c Mon May 14 14:50:05 2012 -0700 @@ -7,7 +7,7 @@ #include <stdint.h> _Bool CompareAndSwapInt32 (int32_t *, int32_t, int32_t) - asm ("libgo_sync.atomic.CompareAndSwapInt32"); + asm ("sync_atomic.CompareAndSwapInt32"); _Bool CompareAndSwapInt32 (int32_t *val, int32_t old, int32_t new) @@ -16,7 +16,7 @@ } _Bool CompareAndSwapInt64 (int64_t *, int64_t, int64_t) - asm ("libgo_sync.atomic.CompareAndSwapInt64"); + asm ("sync_atomic.CompareAndSwapInt64"); _Bool CompareAndSwapInt64 (int64_t *val, int64_t old, int64_t new) @@ -25,7 +25,7 @@ } _Bool CompareAndSwapUint32 (uint32_t *, uint32_t, uint32_t) - asm ("libgo_sync.atomic.CompareAndSwapUint32"); + asm ("sync_atomic.CompareAndSwapUint32"); _Bool CompareAndSwapUint32 (uint32_t *val, uint32_t old, uint32_t new) @@ -34,7 +34,7 @@ } _Bool CompareAndSwapUint64 (uint64_t *, uint64_t, uint64_t) - asm ("libgo_sync.atomic.CompareAndSwapUint64"); + asm ("sync_atomic.CompareAndSwapUint64"); _Bool CompareAndSwapUint64 (uint64_t *val, uint64_t old, uint64_t new) @@ -43,7 +43,7 @@ } _Bool CompareAndSwapUintptr (uintptr_t *, uintptr_t, uintptr_t) - asm ("libgo_sync.atomic.CompareAndSwapUintptr"); + asm ("sync_atomic.CompareAndSwapUintptr"); _Bool CompareAndSwapUintptr (uintptr_t *val, uintptr_t old, uintptr_t new) @@ -52,7 +52,7 @@ } _Bool CompareAndSwapPointer (void **, void *, void *) - asm ("libgo_sync.atomic.CompareAndSwapPointer"); + asm ("sync_atomic.CompareAndSwapPointer"); _Bool CompareAndSwapPointer (void **val, void *old, void *new) @@ -61,7 +61,7 @@ } int32_t AddInt32 (int32_t *, int32_t) - asm ("libgo_sync.atomic.AddInt32"); + asm ("sync_atomic.AddInt32"); int32_t AddInt32 (int32_t *val, int32_t delta) @@ -70,7 +70,7 @@ } uint32_t AddUint32 (uint32_t *, uint32_t) - asm ("libgo_sync.atomic.AddUint32"); + asm ("sync_atomic.AddUint32"); uint32_t AddUint32 (uint32_t *val, uint32_t delta) @@ -79,7 +79,7 @@ } int64_t AddInt64 (int64_t *, int64_t) - asm ("libgo_sync.atomic.AddInt64"); + asm ("sync_atomic.AddInt64"); int64_t AddInt64 (int64_t *val, int64_t delta) @@ -88,7 +88,7 @@ } uint64_t AddUint64 (uint64_t *, uint64_t) - asm ("libgo_sync.atomic.AddUint64"); + asm ("sync_atomic.AddUint64"); uint64_t AddUint64 (uint64_t *val, uint64_t delta) @@ -97,7 +97,7 @@ } uintptr_t AddUintptr (uintptr_t *, uintptr_t) - asm ("libgo_sync.atomic.AddUintptr"); + asm ("sync_atomic.AddUintptr"); uintptr_t AddUintptr (uintptr_t *val, uintptr_t delta) @@ -106,7 +106,7 @@ } int32_t LoadInt32 (int32_t *addr) - asm ("libgo_sync.atomic.LoadInt32"); + asm ("sync_atomic.LoadInt32"); int32_t LoadInt32 (int32_t *addr) @@ -120,7 +120,7 @@ } int64_t LoadInt64 (int64_t *addr) - asm ("libgo_sync.atomic.LoadInt64"); + asm ("sync_atomic.LoadInt64"); int64_t LoadInt64 (int64_t *addr) @@ -134,7 +134,7 @@ } uint32_t LoadUint32 (uint32_t *addr) - asm ("libgo_sync.atomic.LoadUint32"); + asm ("sync_atomic.LoadUint32"); uint32_t LoadUint32 (uint32_t *addr) @@ -148,7 +148,7 @@ } uint64_t LoadUint64 (uint64_t *addr) - asm ("libgo_sync.atomic.LoadUint64"); + asm ("sync_atomic.LoadUint64"); uint64_t LoadUint64 (uint64_t *addr) @@ -162,7 +162,7 @@ } uintptr_t LoadUintptr (uintptr_t *addr) - asm ("libgo_sync.atomic.LoadUintptr"); + asm ("sync_atomic.LoadUintptr"); uintptr_t LoadUintptr (uintptr_t *addr) @@ -176,7 +176,7 @@ } void *LoadPointer (void **addr) - asm ("libgo_sync.atomic.LoadPointer"); + asm ("sync_atomic.LoadPointer"); void * LoadPointer (void **addr) @@ -190,7 +190,7 @@ } void StoreInt32 (int32_t *addr, int32_t val) - asm ("libgo_sync.atomic.StoreInt32"); + asm ("sync_atomic.StoreInt32"); void StoreInt32 (int32_t *addr, int32_t val) @@ -203,7 +203,7 @@ } void StoreInt64 (int64_t *addr, int64_t val) - asm ("libgo_sync.atomic.StoreInt64"); + asm ("sync_atomic.StoreInt64"); void StoreInt64 (int64_t *addr, int64_t val) @@ -216,7 +216,7 @@ } void StoreUint32 (uint32_t *addr, uint32_t val) - asm ("libgo_sync.atomic.StoreUint32"); + asm ("sync_atomic.StoreUint32"); void StoreUint32 (uint32_t *addr, uint32_t val) @@ -229,7 +229,7 @@ } void StoreUint64 (uint64_t *addr, uint64_t val) - asm ("libgo_sync.atomic.StoreUint64"); + asm ("sync_atomic.StoreUint64"); void StoreUint64 (uint64_t *addr, uint64_t val) @@ -242,7 +242,7 @@ } void StoreUintptr (uintptr_t *addr, uintptr_t val) - asm ("libgo_sync.atomic.StoreUintptr"); + asm ("sync_atomic.StoreUintptr"); void StoreUintptr (uintptr_t *addr, uintptr_t val) @@ -255,7 +255,7 @@ } void StorePointer (void **addr, void *val) - asm ("libgo_sync.atomic.StorePointer"); + asm ("sync_atomic.StorePointer"); void StorePointer (void **addr, void *val) diff -r af87954a9464 libgo/go/syscall/errno.c --- a/libgo/go/syscall/errno.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/go/syscall/errno.c Mon May 14 14:50:05 2012 -0700 @@ -10,8 +10,8 @@ /* errno is typically a macro. These functions set and get errno specific to the libc being used. */ -uintptr_t GetErrno() asm ("libgo_syscall.syscall.GetErrno"); -void SetErrno(uintptr_t) asm ("libgo_syscall.syscall.SetErrno"); +uintptr_t GetErrno() asm ("syscall.GetErrno"); +void SetErrno(uintptr_t) asm ("syscall.SetErrno"); uintptr_t GetErrno() diff -r af87954a9464 libgo/go/syscall/signame.c --- a/libgo/go/syscall/signame.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/go/syscall/signame.c Mon May 14 14:50:05 2012 -0700 @@ -11,7 +11,7 @@ #include "arch.h" #include "malloc.h" -String Signame (int sig) asm ("libgo_syscall.syscall.Signame"); +String Signame (int sig) asm ("syscall.Signame"); String Signame (int sig) diff -r af87954a9464 libgo/go/syscall/wait.c --- a/libgo/go/syscall/wait.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/go/syscall/wait.c Mon May 14 14:50:05 2012 -0700 @@ -11,7 +11,7 @@ #include <sys/wait.h> extern _Bool Exited (uint32_t *w) - __asm__ ("libgo_syscall.syscall.Exited.N32_libgo_syscall.syscall.WaitStatus"); + __asm__ ("syscall.Exited.N18_syscall.WaitStatus"); _Bool Exited (uint32_t *w) @@ -20,7 +20,7 @@ } extern _Bool Signaled (uint32_t *w) - __asm__ ("libgo_syscall.syscall.Signaled.N32_libgo_syscall.syscall.WaitStatus"); + __asm__ ("syscall.Signaled.N18_syscall.WaitStatus"); _Bool Signaled (uint32_t *w) @@ -29,7 +29,7 @@ } extern _Bool Stopped (uint32_t *w) - __asm__ ("libgo_syscall.syscall.Stopped.N32_libgo_syscall.syscall.WaitStatus"); + __asm__ ("syscall.Stopped.N18_syscall.WaitStatus"); _Bool Stopped (uint32_t *w) @@ -38,7 +38,7 @@ } extern _Bool Continued (uint32_t *w) - __asm__ ("libgo_syscall.syscall.Continued.N32_libgo_syscall.syscall.WaitStatus"); + __asm__ ("syscall.Continued.N18_syscall.WaitStatus"); _Bool Continued (uint32_t *w) @@ -47,7 +47,7 @@ } extern _Bool CoreDump (uint32_t *w) - __asm__ ("libgo_syscall.syscall.CoreDump.N32_libgo_syscall.syscall.WaitStatus"); + __asm__ ("syscall.CoreDump.N18_syscall.WaitStatus"); _Bool CoreDump (uint32_t *w) @@ -56,7 +56,7 @@ } extern int ExitStatus (uint32_t *w) - __asm__ ("libgo_syscall.syscall.ExitStatus.N32_libgo_syscall.syscall.WaitStatus"); + __asm__ ("syscall.ExitStatus.N18_syscall.WaitStatus"); int ExitStatus (uint32_t *w) @@ -67,7 +67,7 @@ } extern int Signal (uint32_t *w) - __asm__ ("libgo_syscall.syscall.Signal.N32_libgo_syscall.syscall.WaitStatus"); + __asm__ ("syscall.Signal.N18_syscall.WaitStatus"); int Signal (uint32_t *w) @@ -78,7 +78,7 @@ } extern int StopSignal (uint32_t *w) - __asm__ ("libgo_syscall.syscall.StopSignal.N32_libgo_syscall.syscall.WaitStatus"); + __asm__ ("syscall.StopSignal.N18_syscall.WaitStatus"); int StopSignal (uint32_t *w) @@ -89,7 +89,7 @@ } extern int TrapCause (uint32_t *w) - __asm__ ("libgo_syscall.syscall.TrapCause.N32_libgo_syscall.syscall.WaitStatus"); + __asm__ ("syscall.TrapCause.N18_syscall.WaitStatus"); int TrapCause (uint32_t *w __attribute__ ((unused))) diff -r af87954a9464 libgo/runtime/chan.c --- a/libgo/runtime/chan.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/chan.c Mon May 14 14:50:05 2012 -0700 @@ -109,7 +109,7 @@ // For reflect // func makechan(typ *ChanType, size uint32) (chan) uintptr reflect_makechan(ChanType *, uint32) - asm ("libgo_reflect.reflect.makechan"); + asm ("reflect.makechan"); uintptr reflect_makechan(ChanType *t, uint32 size) @@ -568,7 +568,7 @@ // the actual data if it fits, or else a pointer to the data. _Bool reflect_chansend(ChanType *, Hchan *, uintptr, _Bool) - __asm__("libgo_reflect.reflect.chansend"); + __asm__("reflect.chansend"); _Bool reflect_chansend(ChanType *t, Hchan *c, uintptr val, _Bool nb) @@ -605,7 +605,7 @@ }; struct chanrecv_ret reflect_chanrecv(ChanType *, Hchan *, _Bool) - __asm__("libgo_reflect.reflect.chanrecv"); + __asm__("reflect.chanrecv"); struct chanrecv_ret reflect_chanrecv(ChanType *t, Hchan *c, _Bool nb) @@ -1161,7 +1161,7 @@ // For reflect // func chanclose(c chan) -void reflect_chanclose(uintptr) __asm__("libgo_reflect.reflect.chanclose"); +void reflect_chanclose(uintptr) __asm__("reflect.chanclose"); void reflect_chanclose(uintptr c) @@ -1172,7 +1172,7 @@ // For reflect // func chanlen(c chan) (len int32) -int32 reflect_chanlen(uintptr) __asm__("libgo_reflect.reflect.chanlen"); +int32 reflect_chanlen(uintptr) __asm__("reflect.chanlen"); int32 reflect_chanlen(uintptr ca) @@ -1197,7 +1197,7 @@ // For reflect // func chancap(c chan) (cap int32) -int32 reflect_chancap(uintptr) __asm__("libgo_reflect.reflect.chancap"); +int32 reflect_chancap(uintptr) __asm__("reflect.chancap"); int32 reflect_chancap(uintptr ca) diff -r af87954a9464 libgo/runtime/cpuprof.c --- a/libgo/runtime/cpuprof.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/cpuprof.c Mon May 14 14:50:05 2012 -0700 @@ -122,7 +122,7 @@ } extern void runtime_SetCPUProfileRate(int32) - __asm__("libgo_runtime.runtime.SetCPUProfileRate"); + __asm__("runtime.SetCPUProfileRate"); // SetCPUProfileRate sets the CPU profiling rate. // The user documentation is in debug.go. @@ -422,7 +422,7 @@ } extern Slice runtime_CPUProfile(void) - __asm__("libgo_runtime.runtime.CPUProfile"); + __asm__("runtime.CPUProfile"); // CPUProfile returns the next cpu profile block as a []byte. // The user documentation is in debug.go. diff -r af87954a9464 libgo/runtime/go-breakpoint.c --- a/libgo/runtime/go-breakpoint.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/go-breakpoint.c Mon May 14 14:50:05 2012 -0700 @@ -6,7 +6,7 @@ #include <sched.h> -void Breakpoint (void) asm ("libgo_runtime.runtime.Breakpoint"); +void Breakpoint (void) asm ("runtime.Breakpoint"); void Breakpoint (void) diff -r af87954a9464 libgo/runtime/go-caller.c --- a/libgo/runtime/go-caller.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/go-caller.c Mon May 14 14:50:05 2012 -0700 @@ -36,7 +36,7 @@ function/file/line information. */ void RegisterDebugLookup (infofn_type, symvalfn_type) - __asm__ ("libgo_runtime.runtime.RegisterDebugLookup"); + __asm__ ("runtime.RegisterDebugLookup"); void RegisterDebugLookup (infofn_type pi, symvalfn_type ps) @@ -76,9 +76,9 @@ _Bool ok; }; -struct caller_ret Caller (int n) asm ("libgo_runtime.runtime.Caller"); +struct caller_ret Caller (int n) asm ("runtime.Caller"); -Func *FuncForPC (uintptr_t) asm ("libgo_runtime.runtime.FuncForPC"); +Func *FuncForPC (uintptr_t) asm ("runtime.FuncForPC"); /* Implement runtime.Caller. */ @@ -132,7 +132,7 @@ struct funcline_go_return runtime_funcline_go (Func *f, uintptr targetpc) - __asm__ ("libgo_runtime.runtime.funcline_go"); + __asm__ ("runtime.funcline_go"); struct funcline_go_return runtime_funcline_go (Func *f __attribute__((unused)), uintptr targetpc) diff -r af87954a9464 libgo/runtime/go-callers.c --- a/libgo/runtime/go-callers.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/go-callers.c Mon May 14 14:50:05 2012 -0700 @@ -67,7 +67,7 @@ } int Callers (int, struct __go_open_array) - __asm__ ("libgo_runtime.runtime.Callers"); + __asm__ ("runtime.Callers"); int Callers (int skip, struct __go_open_array pc) diff -r af87954a9464 libgo/runtime/go-getgoroot.c --- a/libgo/runtime/go-getgoroot.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/go-getgoroot.c Mon May 14 14:50:05 2012 -0700 @@ -8,7 +8,7 @@ #include "go-string.h" -struct __go_string getgoroot (void) asm ("libgo_runtime.runtime.getgoroot"); +struct __go_string getgoroot (void) asm ("runtime.getgoroot"); struct __go_string getgoroot () diff -r af87954a9464 libgo/runtime/go-now.c --- a/libgo/runtime/go-now.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/go-now.c Mon May 14 14:50:05 2012 -0700 @@ -15,7 +15,7 @@ }; struct time_now_ret now() - __asm__ ("libgo_time.time.now") + __asm__ ("time.now") __attribute__ ((no_split_stack)); struct time_now_ret diff -r af87954a9464 libgo/runtime/go-reflect-map.c --- a/libgo/runtime/go-reflect-map.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/go-reflect-map.c Mon May 14 14:50:05 2012 -0700 @@ -24,7 +24,7 @@ extern struct mapaccess_ret mapaccess (struct __go_map_type *, uintptr_t, uintptr_t) - asm ("libgo_reflect.reflect.mapaccess"); + asm ("reflect.mapaccess"); struct mapaccess_ret mapaccess (struct __go_map_type *mt, uintptr_t m, uintptr_t key_i) @@ -77,7 +77,7 @@ extern void mapassign (struct __go_map_type *, uintptr_t, uintptr_t, uintptr_t, _Bool) - asm ("libgo_reflect.reflect.mapassign"); + asm ("reflect.mapassign"); void mapassign (struct __go_map_type *mt, uintptr_t m, uintptr_t key_i, @@ -118,7 +118,7 @@ } extern int32_t maplen (uintptr_t) - asm ("libgo_reflect.reflect.maplen"); + asm ("reflect.maplen"); int32_t maplen (uintptr_t m) @@ -131,7 +131,7 @@ } extern unsigned char *mapiterinit (struct __go_map_type *, uintptr_t) - asm ("libgo_reflect.reflect.mapiterinit"); + asm ("reflect.mapiterinit"); unsigned char * mapiterinit (struct __go_map_type *mt, uintptr_t m) @@ -145,7 +145,7 @@ } extern void mapiternext (unsigned char *) - asm ("libgo_reflect.reflect.mapiternext"); + asm ("reflect.mapiternext"); void mapiternext (unsigned char *it) @@ -160,7 +160,7 @@ }; extern struct mapiterkey_ret mapiterkey (unsigned char *) - asm ("libgo_reflect.reflect.mapiterkey"); + asm ("reflect.mapiterkey"); struct mapiterkey_ret mapiterkey (unsigned char *ita) @@ -203,7 +203,7 @@ /* Make a new map. We have to build our own map descriptor. */ extern uintptr_t makemap (const struct __go_map_type *) - asm ("libgo_reflect.reflect.makemap"); + asm ("reflect.makemap"); uintptr_t makemap (const struct __go_map_type *t) diff -r af87954a9464 libgo/runtime/go-setenv.c --- a/libgo/runtime/go-setenv.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/go-setenv.c Mon May 14 14:50:05 2012 -0700 @@ -15,7 +15,7 @@ /* Set the C environment from Go. This is called by syscall.Setenv. */ void setenv_c (struct __go_string, struct __go_string) - __asm__ ("libgo_syscall.syscall.setenv_c"); + __asm__ ("syscall.setenv_c"); void setenv_c (struct __go_string k, struct __go_string v) diff -r af87954a9464 libgo/runtime/go-signal.c --- a/libgo/runtime/go-signal.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/go-signal.c Mon May 14 14:50:05 2012 -0700 @@ -408,7 +408,7 @@ /* Used by the os package to raise SIGPIPE. */ -void os_sigpipe (void) __asm__ ("libgo_os.os.sigpipe"); +void os_sigpipe (void) __asm__ ("os.sigpipe"); void os_sigpipe (void) diff -r af87954a9464 libgo/runtime/go-typestring.c --- a/libgo/runtime/go-typestring.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/go-typestring.c Mon May 14 14:50:05 2012 -0700 @@ -9,7 +9,7 @@ #include "go-string.h" struct __go_string typestring(struct __go_empty_interface) - asm ("libgo_runtime.runtime.typestring"); + asm ("runtime.typestring"); struct __go_string typestring (struct __go_empty_interface e) diff -r af87954a9464 libgo/runtime/go-unsafe-new.c --- a/libgo/runtime/go-unsafe-new.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/go-unsafe-new.c Mon May 14 14:50:05 2012 -0700 @@ -12,7 +12,7 @@ /* Implement unsafe_New, called from the reflect package. */ void *unsafe_New (struct __go_empty_interface type) - asm ("libgo_reflect.reflect.unsafe_New"); + asm ("reflect.unsafe_New"); /* The dynamic type of the argument will be a pointer to a type descriptor. */ diff -r af87954a9464 libgo/runtime/go-unsafe-newarray.c --- a/libgo/runtime/go-unsafe-newarray.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/go-unsafe-newarray.c Mon May 14 14:50:05 2012 -0700 @@ -12,7 +12,7 @@ /* Implement unsafe_NewArray, called from the reflect package. */ void *unsafe_NewArray (struct __go_empty_interface type, int n) - asm ("libgo_reflect.reflect.unsafe_NewArray"); + asm ("reflect.unsafe_NewArray"); /* The dynamic type of the argument will be a pointer to a type descriptor. */ diff -r af87954a9464 libgo/runtime/go-unsafe-pointer.c --- a/libgo/runtime/go-unsafe-pointer.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/go-unsafe-pointer.c Mon May 14 14:50:05 2012 -0700 @@ -15,7 +15,7 @@ descriptor. */ extern const struct __go_type_descriptor unsafe_Pointer - asm ("__go_tdn_libgo_unsafe.unsafe.Pointer"); + asm ("__go_tdn_unsafe.Pointer"); /* Used to determine the field alignment. */ struct field_align @@ -61,7 +61,7 @@ it to be defined elsewhere. */ extern const struct __go_ptr_type pointer_unsafe_Pointer - asm ("__go_td_pN27_libgo_unsafe.unsafe.Pointer"); + asm ("__go_td_pN14_unsafe.Pointer"); /* The reflection string. */ #define PREFLECTION "*unsafe.Pointer" diff -r af87954a9464 libgo/runtime/goc2c.c --- a/libgo/runtime/goc2c.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/goc2c.c Mon May 14 14:50:05 2012 -0700 @@ -33,6 +33,9 @@ /* Whether we're emitting for gcc */ static int gcc; +/* Package path to use; only meaningful for gcc */ +static const char *pkgpath; + /* Package prefix to use; only meaningful for gcc */ static const char *prefix; @@ -579,9 +582,13 @@ first = 1; write_params(params, &first); printf(") asm (\""); - if (prefix != NULL) - printf("%s.", prefix); - printf("%s.%s\");\n", package, name); + if (pkgpath != NULL) + printf("%s", pkgpath); + else if (prefix != NULL) + printf("%s.%s", prefix, package); + else + printf("%s", package); + printf(".%s\");\n", name); write_gcc_return_type(package, name, rets); printf(" %s_%s(", package, name); first = 1; @@ -724,7 +731,7 @@ static void usage(void) { - sysfatal("Usage: goc2c [--6g | --gc] [--go-prefix PREFIX] [file]\n"); + sysfatal("Usage: goc2c [--6g | --gc] [--go-pkgpath PKGPATH] [--go-prefix PREFIX] [file]\n"); } void @@ -740,7 +747,11 @@ gcc = 0; else if(strcmp(argv[1], "--gcc") == 0) gcc = 1; - else if (strcmp(argv[1], "--go-prefix") == 0 && argc > 2) { + else if (strcmp(argv[1], "--go-pkgpath") == 0 && argc > 2) { + pkgpath = argv[2]; + argc--; + argv++; + } else if (strcmp(argv[1], "--go-prefix") == 0 && argc > 2) { prefix = argv[2]; argc--; argv++; diff -r af87954a9464 libgo/runtime/malloc.goc --- a/libgo/runtime/malloc.goc Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/malloc.goc Mon May 14 14:50:05 2012 -0700 @@ -23,7 +23,7 @@ extern MStats mstats; // defined in extern.go extern volatile int32 runtime_MemProfileRate - __asm__ ("libgo_runtime.runtime.MemProfileRate"); + __asm__ ("runtime.MemProfileRate"); // Allocate an object of at least size bytes. // Small objects are allocated from the per-thread cache's free lists. @@ -266,7 +266,7 @@ } extern uintptr runtime_sizeof_C_MStats - __asm__ ("libgo_runtime.runtime.Sizeof_C_MStats"); + __asm__ ("runtime.Sizeof_C_MStats"); #define MaxArena32 (2U<<30) diff -r af87954a9464 libgo/runtime/malloc.h --- a/libgo/runtime/malloc.h Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/malloc.h Mon May 14 14:50:05 2012 -0700 @@ -237,7 +237,7 @@ }; extern MStats mstats - __asm__ ("libgo_runtime.runtime.VmemStats"); + __asm__ ("runtime.VmemStats"); // Size classes. Computed and initialized by InitSizes. diff -r af87954a9464 libgo/runtime/mgc0.c --- a/libgo/runtime/mgc0.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/mgc0.c Mon May 14 14:50:05 2012 -0700 @@ -1078,7 +1078,7 @@ } void runtime_ReadMemStats(MStats *) - __asm__("libgo_runtime.runtime.ReadMemStats"); + __asm__("runtime.ReadMemStats"); void runtime_ReadMemStats(MStats *stats) diff -r af87954a9464 libgo/runtime/proc.c --- a/libgo/runtime/proc.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/proc.c Mon May 14 14:50:05 2012 -0700 @@ -1300,7 +1300,7 @@ /* For runtime package testing. */ void runtime_testing_entersyscall(void) - __asm__("libgo_runtime.runtime.entersyscall"); + __asm__("runtime.entersyscall"); void runtime_testing_entersyscall() @@ -1309,7 +1309,7 @@ } void runtime_testing_exitsyscall(void) - __asm__("libgo_runtime.runtime.exitsyscall"); + __asm__("runtime.exitsyscall"); void runtime_testing_exitsyscall() @@ -1416,7 +1416,7 @@ } } -void runtime_Goexit (void) asm ("libgo_runtime.runtime.Goexit"); +void runtime_Goexit (void) asm ("runtime.Goexit"); void runtime_Goexit(void) @@ -1425,7 +1425,7 @@ runtime_goexit(); } -void runtime_Gosched (void) asm ("libgo_runtime.runtime.Gosched"); +void runtime_Gosched (void) asm ("runtime.Gosched"); void runtime_Gosched(void) @@ -1504,7 +1504,7 @@ // for testing of callbacks _Bool runtime_golockedOSThread(void) - asm("libgo_runtime.runtime.golockedOSThread"); + asm("runtime.golockedOSThread"); _Bool runtime_golockedOSThread(void) @@ -1520,7 +1520,7 @@ } int32 runtime_NumGoroutine (void) - __asm__ ("libgo_runtime.runtime.NumGoroutine"); + __asm__ ("runtime.NumGoroutine"); int32 runtime_NumGoroutine() diff -r af87954a9464 libgo/runtime/runtime.c --- a/libgo/runtime/runtime.c Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/runtime.c Mon May 14 14:50:05 2012 -0700 @@ -86,8 +86,8 @@ static int32 argc; static byte** argv; -extern Slice os_Args asm ("libgo_os.os.Args"); -extern Slice syscall_Envs asm ("libgo_syscall.syscall.Envs"); +extern Slice os_Args asm ("os.Args"); +extern Slice syscall_Envs asm ("syscall.Envs"); void runtime_args(int32 c, byte **v) diff -r af87954a9464 libgo/runtime/runtime.h --- a/libgo/runtime/runtime.h Thu May 10 22:25:00 2012 -0700 +++ b/libgo/runtime/runtime.h Mon May 14 14:50:05 2012 -0700 @@ -298,8 +298,8 @@ void runtime_tsleep(int64); M* runtime_newm(void); void runtime_goexit(void); -void runtime_entersyscall(void) __asm__("libgo_syscall.syscall.Entersyscall"); -void runtime_exitsyscall(void) __asm__("libgo_syscall.syscall.Exitsyscall"); +void runtime_entersyscall(void) __asm__("syscall.Entersyscall"); +void runtime_exitsyscall(void) __asm__("syscall.Exitsyscall"); void siginit(void); bool __go_sigsend(int32 sig); int32 runtime_callers(int32, uintptr*, int32); @@ -374,7 +374,7 @@ struct __go_func_type; void reflect_call(const struct __go_func_type *, const void *, _Bool, _Bool, void **, void **) - asm ("libgo_reflect.reflect.call"); + asm ("reflect.call"); /* Functions. */ #define runtime_panic __go_panic @@ -417,11 +417,11 @@ * runtime c-called (but written in Go) */ void runtime_printany(Eface) - __asm__("libgo_runtime.runtime.Printany"); + __asm__("runtime.Printany"); void runtime_newTypeAssertionError(const String*, const String*, const String*, const String*, Eface*) - __asm__("libgo_runtime.runtime.NewTypeAssertionError"); + __asm__("runtime.NewTypeAssertionError"); void runtime_newErrorString(String, Eface*) - __asm__("libgo_runtime.runtime.NewErrorString"); + __asm__("runtime.NewErrorString"); /* * wrapped for go users @@ -431,8 +431,8 @@ int32 runtime_gomaxprocsfunc(int32 n); void runtime_procyield(uint32); void runtime_osyield(void); -void runtime_LockOSThread(void) __asm__("libgo_runtime.runtime.LockOSThread"); -void runtime_UnlockOSThread(void) __asm__("libgo_runtime.runtime.UnlockOSThread"); +void runtime_LockOSThread(void) __asm__("runtime.LockOSThread"); +void runtime_UnlockOSThread(void) __asm__("runtime.UnlockOSThread"); uintptr runtime_memlimit(void); diff -r af87954a9464 libgo/testsuite/gotest --- a/libgo/testsuite/gotest Thu May 10 22:25:00 2012 -0700 +++ b/libgo/testsuite/gotest Mon May 14 14:50:05 2012 -0700 @@ -30,6 +30,7 @@ pkgfiles="" loop=true keep=false +pkgpath= prefix= dejagnu=no GOARCH="" @@ -56,6 +57,15 @@ basedir=`echo $1 | sed -e 's/^--basedir=//'` shift ;; + x--pkgpath) + pkgpath=$2 + shift + shift + ;; + x--pkgpath=*) + pkgpath=`echo $1 | sed -e 's/^--pkgpath=//'` + shift + ;; x--prefix) prefix=$2 shift @@ -310,23 +320,28 @@ package=`echo ${srcdir} | sed -e 's|^.*libgo/go/||'` +pkgpatharg= +xpkgpatharg= prefixarg= -if test -n "$prefix"; then +if test -n "$pkgpath"; then + pkgpatharg="-fgo-pkgpath=$pkgpath" + xpkgpatharg="-fgo-pkgpath=${pkgpath}_test" +elif test -n "$prefix"; then prefixarg="-fgo-prefix=$prefix" fi if test "$trace" = "true"; then - echo $GC -g $prefixarg -c -I . -fno-toplevel-reorder -o _gotest_.o $gofiles $pkgbasefiles + echo $GC -g $pkgpatharg $prefixarg -c -I . -fno-toplevel-reorder -o _gotest_.o $gofiles $pkgbasefiles fi -$GC -g $prefixarg -c -I . -fno-toplevel-reorder -o _gotest_.o $gofiles $pkgbasefiles +$GC -g $pkgpatharg $prefixarg -c -I . -fno-toplevel-reorder -o _gotest_.o $gofiles $pkgbasefiles if $havex; then mkdir -p `dirname $package` cp _gotest_.o `dirname $package`/lib`basename $package`.a if test "$trace" = "true"; then - echo $GC -g -c -I . -fno-toplevel-reorder -o $xofile $xgofiles + echo $GC -g $xpkgpatharg -c -I . -fno-toplevel-reorder -o $xofile $xgofiles fi - $GC -g -c -I . -fno-toplevel-reorder -o $xofile $xgofiles + $GC -g $xpkgpatharg -c -I . -fno-toplevel-reorder -o $xofile $xgofiles fi # They all compile; now generate the code to call them. @@ -343,24 +358,26 @@ ppc*) text="D" ;; esac + symtogo='sed -e s/_test/XXXtest/ -e s/.*_\([^_]*\.\)/\1/ -e s/XXXtest/_test/' + # test functions are named TestFoo # the grep -v eliminates methods and other special names # that have multiple dots. pattern='Test([^a-z].*)?' # The -p option tells GNU nm not to sort. # The -v option tells Solaris nm to sort by value. - tests=$($NM -p -v _gotest_.o $xofile | egrep " $text .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | sed 's/.*\.\(.*\.\)/\1/') + tests=$($NM -p -v _gotest_.o $xofile | egrep " $text .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | $symtogo) if [ "x$tests" = x ]; then echo 'gotest: warning: no tests matching '$pattern in _gotest_.o $xofile 1>&2 exit 2 fi # benchmarks are named BenchmarkFoo. pattern='Benchmark([^a-z].*)?' - benchmarks=$($NM -p -v _gotest_.o $xofile | egrep " $test .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | sed 's/.*\.\(.*\.\)/\1/') + benchmarks=$($NM -p -v _gotest_.o $xofile | egrep " $test .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | $symtogo) # examples are named ExampleFoo pattern='Example([^a-z].*)?' - examples=$($NM -p -v _gotest_.o $xofile | egrep " $text .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | sed 's/.*\.\(.*\.\)/\1/') + examples=$($NM -p -v _gotest_.o $xofile | egrep " $text .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | $symtogo) # package spec echo 'package main'