# error: unable to rename temporary 'sh.o-c707ed27' to output file 'sh.o': 'No such file or ...'



## lightmanhk (Jan 4, 2015)

Hi, all.

I was trying to compile the FreeBSD kernel. However, there was a error given during the `make buildworld`. Hopefully someone can give me some suggestions.

I am following this as a guide to build the kernel.

- The source code was installed from ISO.
- I am compiling it from a Virtualbox VM.


```
$ uname -a
FreeBSD 0x0009 10.1-RC3 FreeBSD 10.1-RC3 #0 r273437: Tue Oct 21 23:55:15 UTC 2014  root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
```


```
# make buildworld
.....
===> bin/csh (all)
cc  -O2 -pipe  -I. -I/usr/src/bin/csh -I/usr/src/bin/csh/../../contrib/tcsh -D_PATH_TCSHELL='"/bin/csh"' -DHAVE_ICONV -std=gnu99 -Qunused-arguments  -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -c /usr/src/bin/csh/../../contrib/tcsh/sh.c
Stack dump:
0.  Program arguments: /usr/obj/usr/src/tmp/usr/bin/cc -cc1 -triple x86_64-unknown-freebsd10.1 -emit-obj -disable-free -disable-llvm-verifier -main-file-name sh.c -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -coverage-file /usr/obj/usr/src/bin/csh/sh.o -resource-dir /usr/obj/usr/src/tmp/usr/bin/../lib/clang/3.4.1 -D _PATH_TCSHELL="/bin/csh" -D HAVE_ICONV -I . -I /usr/src/bin/csh -I /usr/src/bin/csh/../../contrib/tcsh -isysroot /usr/obj/usr/src/tmp -O2 -Wsystem-headers -Werror -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -std=gnu99 -fdebug-compilation-dir /usr/obj/usr/src/bin/csh -ferror-limit 19 -fmessage-length 91 -stack-protector 1 -mstackrealign -fobjc-runtime=gnustep -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o sh.o -x c /usr/src/bin/csh/../../contrib/tcsh/sh.c
1.  <eof> parser at end of file
2.  Per-module optimization passes
3.  Running pass 'CallGraph Pass Manager' on module '/usr/src/bin/csh/../../contrib/tcsh/sh.c'.
4.  Running pass 'Global Value Numbering' on function '@srcunit'
error: unable to rename temporary 'sh.o-c707ed27' to output file 'sh.o':
  'No such file or directory'
1 error generated.
*** Error code 1

Stop.
make[4]: stopped in /usr/src/bin/csh
*** Error code 1

Stop.
make[3]: stopped in /usr/src/bin
*** Error code 1

Stop.
make[2]: stopped in /usr/src
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src
root@0x0009:/usr/src # cd /usr/src/bin/csh/
```

I notice that `make buildworld` isn't necessary in the build process. So I ran `make clean`, removed /usr/obj, and built the kernel without running `make buildworld`. However, a similar error was given:


```
# make buildworld
.....
0.  Program arguments: /usr/bin/cc -cc1 -triple x86_64-unknown-freebsd10.1 -emit-obj -disable-free -disable-llvm-verifier -main-file-name if_ae.c -mrelocation-model static -mdisable-fp-elim -relaxed-aliasing -masm-verbose -mconstructor-aliases -mcode-model kernel -target-cpu x86-64 -target-feature -aes -target-feature -avx -target-feature -mmx -target-feature -sse -disable-red-zone -no-implicit-float -gdwarf-2 -coverage-file /usr/obj/usr/src/sys/GENERIC/if_ae.o -nostdsysteminc -nobuiltininc -resource-dir /usr/bin/../lib/clang/3.4.1 -include opt_global.h -D _KERNEL -D HAVE_KERNEL_OPTION_HEADERS -I . -I /usr/src/sys -I /usr/src/sys/contrib/altq -I /usr/src/sys/contrib/libfdt -O2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -Wmissing-include-dirs -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Werror -std=c99 -fdebug-compilation-dir /usr/obj/usr/src/sys/GENERIC -ferror-limit 19 -fmessage-length 95 -ffreestanding -fformat-extensions -stack-protector 1 -mstackrealign -fobjc-runtime=gnustep -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o if_ae.o -x c /usr/src/sys/dev/ae/if_ae.c
1.  <eof> parser at end of file
2.  Per-function optimization
3.  Running pass 'Simplify the CFG' on function '@ae_stop_txmac'
error: unable to rename temporary 'if_ae.o-f160160a' to output file 'if_ae.o':
  'No such file or directory'
1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/obj/usr/src/sys/GENERIC
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src
```

Anyone have a idea? Thanks a lot.


----------



## wblock@ (Jan 4, 2015)

Was the ISO the same version of FreeBSD as the one running (10.1-RC3)?  Why get the source from there rather than checking it out with Subversion?


----------

