Created attachment 188402 [details] devel/kBuild 0.1.9998_10 build log with error devel/kBuild 0.1.9998_10 [1] * FreeBSD 11.1 amd64 as host * VirtualBox 5.1.28 * host CPU Core i7 920 * FreeBSD 11.1 amd64 as guest * CPUTYPE?=core2 in /etc/make.conf = build fine = [2] * FreeBSD 11.1 amd64 as host * VirtualBox 5.1.30 * host CPU Core 2 Quad Q6600 * FreeBSD 11.1 amd64 as guest * CPUTYPE?=core2 (and without too) in /etc/make.conf = build with error = [3] * FreeBSD 11.1 amd64 on bare metal * CPU Core 2 Quad Q6600 or Core 2 Duo E7200 * CPUTYPE?=core2 in /etc/make.conf = build fine =
Just tested: same situation with kBuild-0.1.9998_9 too.
Sorry but guest does not support same instructions as the host. For example, FreeBSD guest does not support AVX instructions ATM.
Created attachment 188407 [details] diff of cpuid-etallen output host and guest
Created attachment 188408 [details] diff of cpuid output host and guest
Core2 don't support AVX and SSE4.
(In reply to vvd from comment #5) > Core2 don't support AVX and SSE4. My point was we cannot use the same CPUTYPE for both host/guest in general.
BTW, if you look closely, you will see gcc is crashing. /usr/obj/usr/ports/devel/kBuild/work/kBuild-0.1.9998/src/kmk/job.c: In function 'load_too_high': /usr/obj/usr/ports/devel/kBuild/work/kBuild-0.1.9998/src/kmk/job.c:2195:9: internal compiler error: Illegal instruction last_sec = LOAD_WEIGHT_B * job_counter; ^~~~~~~~ I believe you have to recompile gcc without CPUTYPE.
(In reply to Jung-uk Kim from comment #7) > BTW, if you look closely, you will see gcc is crashing. Yes, I saw. > I believe you have to recompile gcc without CPUTYPE. Why it work fine on CPU Core i7 920 with same CPUTYPE in guest system?
(In reply to vvd from comment #8) > Why it work fine on CPU Core i7 920 with same CPUTYPE in guest system? Honestly, I do not know until I see the dumped gcc.core. Basically, VirtualBox masks off some features from host CPUID as you can see from VBox.log. Therefore, it still depends on host CPUID.
(In reply to Jung-uk Kim from comment #9) Can't find gcc.core and no information about cores in /var/log/messages too.
(In reply to vvd from comment #10) Try find /usr/obj/usr/ports/devel/kBuild/work/kBuild-0.1.9998 -name "*.core" BTW, I looked around a bit. Intel Westmere and later CPUs have VT-x "unrestricted guest" feature. When VirtualBox finds the feature from host CPU, it lets guests use certain instructions. I believe that is why your Core i7 is okay. FYI, AMD-V does not have this "restriction".
> find /usr/obj/usr/ports/devel/kBuild/work/kBuild-0.1.9998 -name "*.core" I know and did it, but no *.core files. > Intel Westmere and later CPUs have VT-x "unrestricted guest" feature. When VirtualBox finds the feature from host CPU, it lets guests use certain instructions. I believe that is why your Core i7 is okay. Core i7 920 is Bloomfield, not Westmere. And, afaik, it don't have "unrestricted guest".
(In reply to vvd from comment #12) > I know and did it, but no *.core files. Now I see that it's an internal error message from gcc itself. Just rebuild gcc and try again. > Core i7 920 is Bloomfield, not Westmere. And, afaik, it don't have "unrestricted > guest". Then, I am out of wild guesses.
Error during build GCC (with CPUTYPE?=core2): /opt/obj/usr/ports/lang/gcc6/work/.build/./gcc/xgcc -B/opt/obj/usr/ports/lang/gcc6/work/.build/./gcc/ -B/usr/local/x86_64-portbld-freebsd11.1/bin/ -B/usr/local/x86_64-portbld-freebsd11.1/lib/ -isystem /usr/local/x86_64-portbld-freebsd11.1/include -isystem /usr/local/x86_64-portbld-freebsd11.1/sys-include -g -O2 -pipe -march=core2 -DLIBICONV_PLUG -fno-strict-aliasing -O2 -g -O2 -pipe -march=core2 -DLIBICONV_PLUG -fno-strict-aliasing -DIN_GCC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -pthread -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -pthread -I. -I. -I../.././gcc -I/opt/obj/usr/ports/lang/gcc6/work/gcc-6.4.0/libgcc -I/opt/obj/usr/ports/lang/gcc6/work/gcc-6.4.0/libgcc/. -I/opt/obj/usr/ports/lang/gcc6/work/gcc-6.4.0/libgcc/../gcc -I/opt/obj/usr/ports/lang/gcc6/work/gcc-6.4.0/libgcc/../include -DHAVE_CC_TLS -o _mulxc3.o -MT _mulxc3.o -MD -MP -MF _mulxc3.dep -DL_mulxc3 -c /opt/obj/usr/ports/lang/gcc6/work/gcc-6.4.0/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS /opt/obj/usr/ports/lang/gcc6/work/gcc-6.4.0/libgcc/libgcc2.c: In function '__mulxc3': /opt/obj/usr/ports/lang/gcc6/work/gcc-6.4.0/libgcc/libgcc2.c:1955:6: internal compiler error: Illegal instruction a = COPYSIGN (isinf (a) ? 1 : 0, a); ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ no stack trace because unwind library not available Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. gmake[4]: *** [Makefile:467: _mulxc3.o] Error 1 gmake[4]: Leaving directory '/opt/obj/usr/ports/lang/gcc6/work/.build/x86_64-portbld-freebsd11.1/libgcc' gmake[3]: *** [Makefile:11798: all-target-libgcc] Error 2 gmake[3]: Leaving directory '/opt/obj/usr/ports/lang/gcc6/work/.build' gmake[2]: *** [Makefile:878: all] Error 2 gmake[2]: Leaving directory '/opt/obj/usr/ports/lang/gcc6/work/.build' ===> Compilation failed unexpectedly. Testing build gcc without any CPUTYPE.
(In reply to vvd from comment #14) > Testing build gcc without any CPUTYPE. I got the same error without CPUTYPE!
(In reply to vvd from comment #15) Tested all build options of lang/gcc6 - same error. One more time about environment: * FreeBSD 11.1 amd64 as host * VirtualBox 5.1.30 * host CPU Core 2 Quad Q6600 * FreeBSD 11.1 amd64 as guest
GCC 9.2.0, FreeBSD 12.0 - build fine now.