Hmm, OK, sounds like 'sed' is not the issue. >>I found there are only two files (CMakeLists.txt and gotestprogram.sh) under the llvm/tools/gollvm/gotools/. Should the missing files (e.g. buildid.go) be there?
No, this is expected. The Go sources for 'buildid' will be pulled from <LLVMROOT>/tools/gollvm/gofrontend/libgo/go/cmd/buildid. At this point what I would recommend to gather more info: rerun cmake and pass it the "--trace-expand" flag, e.g. cmake --trace-expand -DCMAKE_BUILD_TYPE=Debug -DLLVM_USE_LINKER=gold ../llvm Be warned that this will produce a huge amount of output (~40M or so). Sift through the output and see if you can find the place where it is trying to locate the source files for the buildid tool by running 'match.sh'. Should look something like /root/llvm/tools/gollvm/gotools/CMakeLists.txt(55): if(NOT EXISTS /root/llvm/tools/gollvm/gofrontend/libgo/go/cmd/buildid ) /root/llvm/tools/gollvm/gotools/CMakeLists.txt(57): else() /root/llvm/tools/gollvm/gotools/CMakeLists.txt(58): set(tool_target gotools_cmd_buildid ) /root/llvm/tools/gollvm/gotools/CMakeLists.txt(62): execute_process(COMMAND /bin/bash /root/llvm/tools/gollvm/gofrontend/libgo/match.sh --goarch=amd64 --goos=linux --srcdir=/root/llvm/tools/gollvm/gofrontend/libgo/go/cmd/buildid OUTPUT_VARIABLE toolfiles ERROR_VARIABLE errmsg RESULT_VARIABLE exitstatus ) /root/llvm/tools/gollvm/gotools/CMakeLists.txt(68): if(NOT 0 MATCHES 0 ) /root/llvm/tools/gollvm/gotools/CMakeLists.txt(71): string(STRIP /root/llvm/tools/gollvm/gofrontend/libgo/go/cmd/buildid/buildid.go /root/llvm/tools/gollvm/gofrontend/libgo/go/cmd/buildid/doc.go toolfiles ) I am thinking that maybe there is something going wrong with the invocation of 'match.sh' in your case that is throwing things off. Thanks, Than On Wed, May 8, 2019 at 11:30 AM Ting Yuan <yuant...@ict.ac.cn> wrote: > Hi Than, > > On my system the version of sed is 4.4. Is the version mismatch? > > I found there are only two files (CMakeLists.txt and gotestprogram.sh) > under the llvm/tools/gollvm/gotools/. Should the missing files (e.g. > buildid.go) be there? > > Thanks. > > On Wednesday, May 8, 2019 at 8:50:23 PM UTC+8, Than McIntosh wrote: >> >> Hi, >> >> From the error output it sounds like something went wrong with the >> initial cmake run -- the error from match.sh seems nonsensical (it suggests >> that the script is looking for gotools sources in the wrong location). >> >> One possibility would be that you don't have "sed" installed on your >> system? >> >> Thanks, Than >> >> >> On Tue, May 7, 2019 at 9:56 PM Ting Yuan <yuan...@ict.ac.cn> wrote: >> >>> Hello Than, >>> when I using ninja to build gollvm, just like >>> >>> % cmake -DCMAKE_INSTALL_PREFIX=/home/yt/LLVMsvn/install - >>> DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Debug -DLLVM_USE_LINKER=gold >>> -G "Ninja" ../llvm >>> % ninja gollvm >>> >>> the build system still reports an error: >>> >>> ninja: error: >>> '/home/yt/LLVMsvn/llvm-project/llvm/tools/gollvm/gotools/buildid.go', >>> needed by 'tools/gollvm/gotools/buildid', missing and no known rule to >>> make it >>> >>> I notice that some warnings are raised during the configuration like: >>> >>> /home/yt/LLVMsvn/llvm-project/llvm/tools/gollvm/gofrontend/libgo/match.sh:138: >>> no such file or directory: action.go build.go buildid.go exec.go gc.go >>> gccgo.go init.go security.go testgo.go >>> >>> Is there something I missing ? >>> >>> >>> >>> 在 2019年5月7日星期二 UTC+8下午9:48:48,Than McIntosh写道: >>>> >>>> Hello, >>>> For the gollvm build ninja is recommended (using "make" is untested and >>>> I doubt if it will work). >>>> Thanks, Than >>>> >>>> >>>> On Tue, May 7, 2019 at 9:27 AM <yuan...@ict.ac.cn> wrote: >>>> >>>>> I try to build gollvm on ubuntu(x64) following these commands in >>>>> https://go.googlesource.com/gollvm/ : >>>>> >>>>> % cd workarea >>>>> % mkdir build-debug >>>>> % cd build-debug >>>>> % cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_USE_LINKER=gold ../llvm >>>>> ... >>>>> % make gollvm -j4 >>>>> ... >>>>> % >>>>> >>>>> but I got >>>>> >>>>> -- Targeting X86 >>>>> -- starting libgo configuration. >>>>> /home/yt/LLVMsvn/llvm-project/llvm/tools/gollvm/gofrontend/libgo/match >>>>> .sh:138: no such file or directory: common.go format.go reader.go >>>>> stat_actime1.go stat_actime2.go stat_unix.go strconv.go writer.go >>>>> /home/yt/LLVMsvn/llvm-project/llvm/tools/gollvm/gofrontend/libgo/match >>>>> .sh:138: no such file or directory: reader.go register.go struct.go >>>>> writer.go >>>>> ...... >>>>> -- Performing Test HAVE_STEADY_CLOCK -- success >>>>> -- Configuring done >>>>> -- Generating done >>>>> -- Build files have been written to: /home/yt/LLVMsvn/llvm-project/ >>>>> debug >>>>> ... >>>>> [ 0%] Built target LLVMDemangle >>>>> [ 0%] Built target GoDumpSpecMacroParser >>>>> ... >>>>> [ 50%] Building Go package 'runtime' (non-PIC) >>>>> /home/yt/LLVMsvn/llvm-project/debug/tools/gollvm/libgo/sigtab.go:5:21: >>>>> error: use of undefined type 'sigTabT' >>>>> /home/yt/LLVMsvn/llvm-project/debug/tools/gollvm/libgo/sigtab.go:7:12: >>>>> error: reference to undefined name '_SigNotify' >>>>> /home/yt/LLVMsvn/llvm-project/debug/tools/gollvm/libgo/sigtab.go:7:25: >>>>> error: reference to undefined name '_SigKill' >>>>> /home/yt/LLVMsvn/llvm-project/debug/tools/gollvm/libgo/sigtab.go:8:12: >>>>> error: reference to undefined name '_SigNotify' >>>>> ... >>>>> tools/gollvm/libgo/CMakeFiles/libgo_runtime.dir/build.make:64: recipe >>>>> for target 'tools/gollvm/libgo/runtime.o' failed >>>>> make[3]: *** [tools/gollvm/libgo/runtime.o] Error 3 >>>>> CMakeFiles/Makefile2:16487: recipe for target >>>>> 'tools/gollvm/libgo/CMakeFiles/libgo_runtime.dir/all' failed >>>>> make[2]: *** [tools/gollvm/libgo/CMakeFiles/libgo_runtime.dir/all] >>>>> Error 2 >>>>> CMakeFiles/Makefile2:11625: recipe for target >>>>> 'tools/gollvm/CMakeFiles/gollvm.dir/rule' failed >>>>> make[1]: *** [tools/gollvm/CMakeFiles/gollvm.dir/rule] Error 2 >>>>> Makefile:3475: recipe for target 'gollvm' failed >>>>> make: *** [gollvm] Error 2 >>>>> >>>>> I have no idea about this problem. Should I switch make to ninja (like >>>>> the document said)? >>>>> >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "golang-nuts" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to golan...@googlegroups.com. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/golang-nuts/4529d46b-caf4-475f-bcda-273c1bca5016%40googlegroups.com >>>>> <https://groups.google.com/d/msgid/golang-nuts/4529d46b-caf4-475f-bcda-273c1bca5016%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "golang-nuts" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to golan...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/golang-nuts/ed517fe7-e180-4d0b-b134-f8ee76427ebf%40googlegroups.com >>> <https://groups.google.com/d/msgid/golang-nuts/ed517fe7-e180-4d0b-b134-f8ee76427ebf%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/92cbfe57-f1fb-467d-b935-394a842f597e%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/92cbfe57-f1fb-467d-b935-394a842f597e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CA%2BUr55HmTLODKpNOkjsxLnqURwrvzxnttN1m-zR79LrsdjPHVg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.