uname -a FreeBSD localhost 11.0-CURRENT FreeBSD 11.0-CURRENT #5 r268088: Tue Jul 1 23:31:59 MSK 2014 root@localhost:/usr/obj/usr/src/sys/GENERIC i386 FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 Target: i386-unknown-freebsd11.0 Thread model: posix --- core_dyn_x86.o --- In file included from core_dyn_x86.cpp:185: ./core_dyn_x86/risc_x86.h:134:3: error: inline assembly requires more registers than available "pushl %%ebp \n" ^ 4 warnings and 1 error generated. *** [core_dyn_x86.o] Error code 1 make[6]: stopped in /usr/ports/emulators/dosbox/work/dosbox-0.74/src/cpu 1 error --- gcc47 -v Using built-in specs. COLLECT_GCC=gcc47 COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc47/gcc/i386-portbld-freebsd11.0/4.7.3/lto-wrapper Target: i386-portbld-freebsd11.0 Configured with: ./../gcc-4.7.3/configure --disable-bootstrap --disable-nls --enable-gnu-indirect-function --libdir=/usr/local/lib/gcc47 --libexecdir=/usr/local/libexec/gcc47 --program-suffix=47 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc47/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --with-ecj-jar=/usr/local/share/java/ecj-4.5.jar --enable-languages=c,c++,objc,fortran,java --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc47 --build=i386-portbld-freebsd11.0 Thread model: posix gcc version 4.7.3 (FreeBSD Ports Collection) build fine. It's well-known registers problem of clang.
Other clangs from ports work fine: clang32 -v clang version 3.2 (tags/RELEASE_32/final) Target: i386-portbld-freebsd11.0 Thread model: posix clang33 -v clang version 3.3 (tags/RELEASE_33/final) Target: i386-portbld-freebsd11.0 Thread model: posix but failing clang34 -v clang version 3.4 (tags/RELEASE_34/final) Target: i386-portbld-freebsd11.0 Thread model: posix Selected GCC installation:
Notify maintainer.
Hello, maintainer here. I'm aware of the issue and have been working with the devs for a fix. I have a potential patch. It builds, but so far I've been unable to test that it doesn't break something. I'll see if I can test it today.
Tom, do you have an update yet?
Sorry for the delay, have some major issues with my machine, so I can't make a patch. I can give instructions, however: src/cpu/core_dyn_x86/risc_x86.h Change line 141 from: :"r" (tempflags),"r" (code) to: :"a" (tempflags),"a" (code) This should at least fix compilation, but I'm unable to test if it breaks anything. If someone could make this into a patch and more importantly test that it runs and test a few games with it, that would be great.
cherry picking
(In reply to Tom Carrick from comment #5) > Sorry for the delay, have some major issues with my machine, so I can't make > a patch. I can give instructions, however: [...] This patch helps the build on 11-CURRENT to succeed, but resulting package apparently has some problem. For example, when trying to run Borland C++ 3.1 suite (both IDE, bc.exe, or just the compiler, bcc.exe) results in DOSBox crash with the following message: DOSBox switched to max cycles, because of the setting: cycles=auto. If the game runs too fast try a fixed cycles amount in DOSBox's options. Trace/BPT trap(core dumped) The build is broken with USE_GCC as well. Thus, it looks like DOSBox is severely broken on -CURRENT right now. Building it on 8.4-STABLE works flawlessly and I am able to run Borland C++ 3.1 just fine.
It's time for a deep investigation. But sorry if I have to delay it for a few days.
There appears to have been some communication error. The correct line is :"a" (tempflags),"r" (code) I'm not a FreeBSD user, but I've quickly tested this in one of the available FreeBSD 32-bit VM images with clang 3.4.1, and it appears to fix the compilation error.
(In reply to Willem Jan Palenstijn from comment #9) > There appears to have been some communication error. The correct line is > > :"a" (tempflags),"r" (code) I confirm that with this change, I can build DOSBox with Clang on FreeBSD/i386 11-CURRENT and successfully run Borland C++ 3.1 IDE, thanks! However, it still does not build with USE_GCC (for an unrelated reason though).
USE_GCC problem aside, we ca
If it works with Borland, USE_GCC problem aside, I think we can commit the fix and close the PR.
A commit references this bug: Author: rodrigo Date: Wed Dec 31 14:36:58 UTC 2014 New revision: 375888 URL: https://svnweb.freebsd.org/changeset/ports/375888 Log: Fix build and running issues with clang on 11 and beyond Bump portrevision PR: 191630 Submitted by: knyght@gmail.com Changes: head/emulators/dosbox/Makefile head/emulators/dosbox/files/patch-src_cpu_core_dyn_x86_risc_x86.h
committed, thanks