error building clang in HEAD

2 views
Skip to first unread message

Gary Jennejohn

unread,
Jun 23, 2018, 9:45:04 AM6/23/18
to
There is a strange error building clang with this use case:

cd /usr/src
make -j10 makeworld

which produces this error output:

===> lib/clang/libclang (all)
error: unable to rename temporary 'Sema/SemaTemplate-12ad7e30.o.tmp' to output file 'Sema/SemaTemplate.o': 'No such file or directory'
1 error generated.
--- Sema/SemaTemplate.o ---
*** [Sema/SemaTemplate.o] Error code 1

make[6]: stopped in /usr/src/lib/clang/libclang
.ERROR_TARGET='Sema/SemaTemplate.o'
.ERROR_META_FILE='/usr/obj/usr/src/amd64.amd64/lib/clang/libclang/Sema_SemaTemplate.o.meta'
.MAKE.LEVEL='6'
MAKEFILE=''
.MAKE.MODE='meta missing-filemon=yes missing-meta=yes silent=yes'
_ERROR_CMD='c++ -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -O2 -pipe -DNO_MALLOC_EXTRAS -I/usr/obj/usr/src/amd64.amd64/lib/clang/libclang -I/usr/obj/usr/src/amd64.amd64/lib/clang/libllvm -I/usr/src/contrib/llvm/tools/clang/lib/Basic -I/usr/src/contrib/llvm/tools/clang/lib/Driver -I/usr/src/contrib/llvm/tools/clang/include -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_STATIC_ANALYZER -I/usr/src/lib/clang/include -I/usr/src/contrib/llvm/include -DLLVM_BUILD_GLOBAL_ISEL -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DLLVM_DEFAULT_TARGET_TRIPLE=\"x86_64-unknown-freebsd12.0\" -DLLVM_HOST_TRIPLE=\"x86_64-unknown-freebsd12.0\" -DDEFAULT_SYSROOT=\"\" -DLLVM_TARGET_ENABLE_X86 -DLLVM_NATIVE_ASMPARSER=LLVMInitializeX86AsmParser -DLLVM_NATIVE_ASMPRINTER=LLVMInitializeX86AsmPrinter -DLLVM_NATIVE_DISASSEMBLER=LLVMInitializeX86Disassembler -DLLVM_NATIVE_TARGET=LLVMInitializeX86Target -DLLVM_NATIVE_TARGETINFO=LLVMInitializeX86Tar
getInfo -DLLVM_NATIVE_TARGETMC=LLVMInitializeX86TargetMC -ffunction-sections -fdata-sections -Qunused-arguments -DNO_MALLOC_EXTRAS -std=c++11 -fno-exceptions -fno-rtti -stdlib=libc++ -Wno-c++11-extensions -c /usr/src/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp -o Sema/SemaTemplate.o;'
.CURDIR='/usr/src/lib/clang/libclang'
.MAKE='make'
.OBJDIR='/usr/obj/usr/src/amd64.amd64/lib/clang/libclang'
.TARGETS='all'
DESTDIR='/usr/obj/usr/src/amd64.amd64/tmp'
LD_LIBRARY_PATH=''
MACHINE='amd64'
MACHINE_ARCH='amd64'
MAKEOBJDIRPREFIX=''
MAKESYSPATH='/usr/src/share/mk'
MAKE_VERSION='20180512'
PATH='/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin'
SRCTOP='/usr/src'
OBJTOP='/usr/obj/usr/src/amd64.amd64'
.MAKE.MAKEFILES='/usr/src/share/mk/sys.mk /usr/src/share/mk/local.sys.env.mk /usr/src/share/mk/src.sys.env.mk /etc/src-env.conf /usr/src/share/mk/bsd.mkopt.mk /usr/src/share/mk/src.sys.obj.mk /usr/src/share/mk/auto.obj.mk /usr/src/share/mk/bsd.suffixes.mk /etc/make.conf /usr/src/share/mk/local.sys.mk /usr/src/share/mk/src.sys.mk /etc/src.conf /usr/src/lib/clang/libclang/Makefile /usr/src/share/mk/src.opts.mk /usr/src/share/mk/bsd.own.mk /usr/src/share/mk/bsd.opts.mk /usr/src/share/mk/bsd.cpu.mk /usr/src/share/mk/bsd.compiler.mk /usr/src/share/mk/bsd.linker.mk /usr/src/lib/clang/clang.pre.mk /usr/src/lib/clang/llvm.pre.mk /usr/src/lib/clang/clang.build.mk /usr/src/lib/clang/llvm.build.mk /usr/src/share/mk/bsd.lib.mk /usr/src/share/mk/bsd.init.mk /usr/src/share/mk/local.init.mk /usr/src/share/mk/src.init.mk /usr/src/lib/clang/libclang/../Makefile.inc /usr/src/share/mk/bsd.libnames.mk /usr/src/share/mk/src.libnames.mk /usr/src/share/mk/bsd.symver.mk /usr/src/share/mk/bsd.nls.mk /usr/src
/share/mk/bsd.files.mk /usr/src/share/mk/bsd.incs.mk /usr/src/share/mk/bsd.confs.mk /usr/src/share/mk/bsd.links.mk /usr/src/share/mk/bsd.dep.mk /usr/src/share/mk/bsd.clang-analyze.mk /usr/src/share/mk/bsd.obj.mk /usr/src/share/mk/bsd.subdir.mk /usr/src/share/mk/bsd.sys.mk'
.PATH='. /usr/src/lib/clang/libclang /usr/src/contrib/llvm/tools/clang/lib'
1 error

However, if I do this

cd /usr/src/lib/clang/libclang
make -j10 depend all

it succeeds.

I have META_MODE enabled.

It also succeeds with a simple make buildworld, but that's extremely
slow.

Note that this started happening after rm -rf /usr/obj/usr.

--
Gary Jennejohn
_______________________________________________
freebsd...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

Dimitry Andric

unread,
Jun 23, 2018, 11:09:25 AM6/23/18
to
On 23 Jun 2018, at 15:40, Gary Jennejohn <gljen...@gmail.com> wrote:
>
> There is a strange error building clang with this use case:
>
> cd /usr/src
> make -j10 makeworld

What's the "makeworld" target? I've not heard of this.


> which produces this error output:
>
> ===> lib/clang/libclang (all)
> error: unable to rename temporary 'Sema/SemaTemplate-12ad7e30.o.tmp' to output file 'Sema/SemaTemplate.o': 'No such file or directory'
> 1 error generated.
> --- Sema/SemaTemplate.o ---
> *** [Sema/SemaTemplate.o] Error code 1

This typically happens if "make obj" was not run before the rest of the
make targets. Normally, the order is: make obj, then make depend, then
make (a.k.a. make all).

Is there a directory /usr/obj/usr/src/lib/libclang/Sema ?


> Note that this started happening after rm -rf /usr/obj/usr.

Indeed, that caused the subdirectories under the obj directories to have
disappeared. For some reason, in your situation, "make obj" is not run
correctly.

-Dimitry

signature.asc

Mark Millard

unread,
Jun 23, 2018, 11:23:50 AM6/23/18
to
Gary Jennejohn gljennjohn at gmail.com wrote on
Sat Jun 23 13:41:00 UTC 2018 :

> cd /usr/src
> make -j10 makeworld
>
> which produces this error output:
>
> ===> lib/clang/libclang (all)
> error: unable to rename temporary 'Sema/SemaTemplate-12ad7e30.o.tmp' to output file 'Sema/SemaTemplate.o': 'No such file or directory'
> 1 error generated.
> --- Sema/SemaTemplate.o ---
> *** [Sema/SemaTemplate.o] Error code 1

What version of head ( -r?????? )?

Is this an AMD Ryzen, AMD Ryzen Threadripper, or AMD Epyc
context? If not, what is the alternative in use? Other
details could be relevant as well.

There was a time when there were various reports of such
for Ryzen variants but the failure would not be on the
same file each time and some builds would work. (I've
seen such myself but likely will not have access to a
Ryzen context again and it will likely be months for
access to a Ryzen Threadripper. So I'm just suggesting
additional information to report.)

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)
Reply all
Reply to author
Forward
0 new messages