Weird. I am scratching my head.
At this point if I was debugging it myself on your system I would rerun
cmake passing it the "--trace-expand" flag (which will generate giant
volumes of output), then look in the trace to see what is happening when
the cmake rules in question fire. You should see something like
...
/mybuildarea/llvm-project/llvm/tools/gollvm/libgo/CMakeLists.txt(232):
set(zgoarchdotgo ${libgo_binroot}/zgoarch.go )
/mybuildarea/llvm-project/llvm/tools/gollvm/libgo/CMakeLists.txt(233):
set(zgoarchtmp ${libgo_binroot}/zgoarch.go.tmp )
/mybuildarea/llvm-project/llvm/tools/gollvm/libgo/CMakeLists.txt(234):
mkzgoarch(${goarch} ${zgoarchtmp} ${libgo_scriptroot} )
/mybuildarea/llvm-project/llvm/tools/gollvm/cmake/modules/AutoGenGo.cmake(75):
file(REMOVE ${outfile} )
/mybuildarea/llvm-project/llvm/tools/gollvm/cmake/modules/AutoGenGo.cmake(76):
file(WRITE ${outfile} package goarch\n\n )
/mybuildarea/llvm-project/llvm/tools/gollvm/cmake/modules/AutoGenGo.cmake(78):
file(APPEND ${outfile} const GOARCH = \"${goarch}\"\n\n )
...
If these rules are not firing, then hopefully the trace output will have
some suggestion as to why.
Thanks, Than
On Tue, Oct 25, 2022 at 3:29 AM Alex Markin <[email protected]> wrote:
> > Do you have tools/gollvm/libgo/zgoarch.go.tmp in your build area? What
> sort of content is in that file?
>
> No
>
> $ ninja -v -d explain tools/gollvm/libgo/zgoarch.go
> ninja: error: unknown target 'tools/gollvm/libgo/zgoarch.go'
>
> $ gcc -dumpmachine
> x86_64-pc-linux-gnu
>
> $ clang -dumpmachine
> x86_64-pc-linux-gnu
>
> I tried manually setting up different target triples (for example the same
> as on a working machine) but
> it did not help.
>
>
> чт, 20 окт. 2022 г. в 15:48, Than McIntosh <[email protected]>:
>
>> >There is no zgoarch.go file in the build area. It seems that it was not
>> created by the build system.
>>
>> I've oversimplified things a bit -- what cmake does is write
>> out tools/gollvm/libgo/zgoarch.go.tmp, and then add a build rule
>> for zgoarch.go that copies the *.tmp file to the *.go file if they are
>> different.
>>
>> Do you have tools/gollvm/libgo/zgoarch.go.tmp in your build area? What
>> sort of content is in that file? What happens when you do
>>
>> $ ninja -v -d explain tools/gollvm/libgo/zgoarch.go
>>
>> You should see something like
>>
>> ninja explain: output tools/gollvm/libgo/zgoarch.go doesn't exist
>> [1/1] cd /x/llvm-project/build-relwithdbg/tools/gollvm/libgo &&
>> /usr/bin/cmake -E copy_if_different
>> /x/llvm-project/build-relwithdbg/tools/gollvm/libgo/zgoarch.go.tmp
>> /x/llvm-project/build-relwithdbg/tools/gollvm/libgo/zgoarch.go
>>
>> Thanks, Than
>>
>>
>>
>>
>> On Wed, Oct 19, 2022 at 5:42 PM Alex Markin <[email protected]> wrote:
>>
>>> There is no zgoarch.go file in the build area. It seems that it was not
>>> created by the build system. I watched the logs and there were no lines to
>>> create it. In the directory libgo I have only the following *go files:
>>>
>>> epoll.go goroot.go libcalls.go syscall_arch.go tmp-libcalls.go
>>>
>>> So I can't understand why the rule for zgoarch is not called. Probably
>>> some env variable?
>>>
>>> ср, 19 окт. 2022 г. в 16:47, Than McIntosh <[email protected]>:
>>>
>>>> Hi,
>>>>
>>>> Those constants are supposed to be defined in the generated file
>>>> <buildarea>/tools/gollvm/libgo/zgoarch.go, which is written as out part of
>>>> the gollvm build process, e.g. here
>>>>
>>>>
>>>> https://go.googlesource.com/gollvm/+/253c122ed62d5e9a32a9806e83c47a389a6435bf/cmake/modules/AutoGenGo.cmake#63
>>>>
>>>> What does the zgoarch.go file look like in your build area?
>>>>
>>>> Thanks, Than
>>>>
>>>>
>>>> On Wed, Oct 19, 2022 at 8:20 AM Alex Markin <[email protected]>
>>>> wrote:
>>>>
>>>>> Hello.
>>>>>
>>>>> I'm trying to build gollvm on my gentoo system and get the following
>>>>> error:
>>>>>
>>>>> FAILED: tools/gollvm/libgo/internal/.pic/goarch.o
>>>>> /home/alex/test/gollvm/build-debug/tools/gollvm/libgo/internal/.pic/goarch.o
>>>>>
>>>>> cd /home/alex/test/gollvm/build-debug/tools/gollvm/libgo &&
>>>>> /usr/bin/cmake -E make_directory ./internal/.pic &&
>>>>> /home/alex/test/gollvm/build-debug/./bin/llvm
>>>>> -goc -c -o
>>>>> /home/alex/test/gollvm/build-debug/tools/gollvm/libgo/internal/.pic/goarch.o
>>>>> -fPIC -fgo-pkgpath=internal/goarch -I . /home/alex/test/gollvm/llvm-p
>>>>> roject/llvm/tools/gollvm/gofrontend/libgo/go/internal/goarch/goarch.go
>>>>> /home/alex/test/gollvm/llvm-project/llvm/tools/gollvm/gofrontend/libgo/go/internal/goarch/goarch.go:15:35:
>>>>> error: reference to undefined name '_ArchFamily'
>>>>> /home/alex/test/gollvm/llvm-project/llvm/tools/gollvm/gofrontend/libgo/go/internal/goarch/goarch.go:18:19:
>>>>> error: reference to undefined name '_BigEndian'
>>>>> /home/alex/test/gollvm/llvm-project/llvm/tools/gollvm/gofrontend/libgo/go/internal/goarch/goarch.go:21:29:
>>>>> error: reference to undefined name '_DefaultPhysPa
>>>>> geSize'
>>>>> /home/alex/test/gollvm/llvm-project/llvm/tools/gollvm/gofrontend/libgo/go/internal/goarch/goarch.go:25:19:
>>>>> error: reference to undefined name '_PCQuantum'
>>>>> /home/alex/test/gollvm/llvm-project/llvm/tools/gollvm/gofrontend/libgo/go/internal/goarch/goarch.go:28:20:
>>>>> error: reference to undefined name '_Int64Align'
>>>>> /home/alex/test/gollvm/llvm-project/llvm/tools/gollvm/gofrontend/libgo/go/internal/goarch/goarch.go:35:22:
>>>>> error: reference to undefined name '_MinFrameSize'
>>>>> /home/alex/test/gollvm/llvm-project/llvm/tools/gollvm/gofrontend/libgo/go/internal/goarch/goarch.go:39:20:
>>>>> error: reference to undefined name '_StackAlign'
>>>>>
>>>>> What can be the reason of such error? On another ubuntu system
>>>>> everything goes correctly.
>>>>>
>>>>> The cmake line:
>>>>>
>>>>> cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++
>>>>> -DCMAKE_C_COMPILER=clang -G Ninja ../llvm-project/llvm
>>>>>
>>>>> --
>>>>> 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 [email protected].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/golang-nuts/9ad0d8dc-d118-45d2-984e-9cdf36ab4f28n%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/golang-nuts/9ad0d8dc-d118-45d2-984e-9cdf36ab4f28n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/CA%2BUr55ESeCD9fjZFwnbAY0boDQ_o4sZbABgWhK7bVMaQvuO5TA%40mail.gmail.com.