Compiling on 32-bit GNU/Linux chokes on asm

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
stdh
Posts: 4
Joined: Mon May 22, 2017 1:47 pm

Compiling on 32-bit GNU/Linux chokes on asm

Post by stdh »

As I posted in the 3.0.1 release thread, but it happens with 3.1.0 as well: if I try to compile on my old i386 laptop with Debian testing, with GCC 6.3.0 (SVN 20170425), I get the following error:

Code: Select all

gzdoom-g3.1.0/build$ cmake .. -DCMAKE_BUILD_TYPE=Release
 [snip]
gzdoom-g3.1.0/build$ make
 [snip]
[ 67%] Building CXX object src/CMakeFiles/zdoom.dir/g_statusbar/sbar_mugshot.cpp.o
[ 67%] Building CXX object src/CMakeFiles/zdoom.dir/g_statusbar/shared_sbar.cpp.o
In file included from gzdoom-g3.1.0/src/./m_bbox.h:32:0,
                 from gzdoom-g3.1.0/src/./r_defs.h:35,
                 from gzdoom-g3.1.0/src/./v_collection.h:38,
                 from gzdoom-g3.1.0/src/g_statusbar/sbar.h:39,
                 from gzdoom-g3.1.0/src/g_statusbar/shared_sbar.cpp:39:
gzdoom-g3.1.0/src/./m_fixed.h: In function ‘void DBaseStatusBar::DrawCrosshair()’:
gzdoom-g3.1.0/src/./m_fixed.h:29:5: error: ‘asm’ operand has impossible constraints
    );
     ^
src/CMakeFiles/zdoom.dir/build.make:5268: recipe for target 'src/CMakeFiles/zdoom.dir/g_statusbar/shared_sbar.cpp.o' failed
make[2]: *** [src/CMakeFiles/zdoom.dir/g_statusbar/shared_sbar.cpp.o] Error 1
CMakeFiles/Makefile2:788: recipe for target 'src/CMakeFiles/zdoom.dir/all' failed
make[1]: *** [src/CMakeFiles/zdoom.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Since I read someplace that such asm errors may be related to optimization, I tried a Debug build and that just works.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Compiling on 32-bit GNU/Linux chokes on asm

Post by _mental_ »

Could you please try to change line 28 of src/m_fixed.h from : "cc" to : "%cc", i.e. to add a percent character?
stdh
Posts: 4
Joined: Mon May 22, 2017 1:47 pm

Re: Compiling on 32-bit GNU/Linux chokes on asm

Post by stdh »

Hi _mental_, unfortunately that doesn't solve it, I get the exact same error. Not sure if it's got anything to do with this, but I noticed some fails in cmake's output. Note that ccache is not the culprit, I tried without it in a clean build directory and the results were the same.
Spoiler: cmake output
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Compiling on 32-bit GNU/Linux chokes on asm

Post by _mental_ »

Unfortunately there is nothing I can do with this. It seems to be a bug within GCC 6 from Debian Testing.

I checked with the following versions of GCC 6 from Debian Stretch RC4, Ubuntu 17.04 and Mint 18.1 (all 32-bit):

Code: Select all

g++ (Debian 6.3.0-18) 6.3.0 20170516
g++ (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
g++-6 (Ubuntu/Linaro 6.3.0-18ubuntu2~16.04) 6.3.0 20170519
Only Debian's GCC 6 has the mentioned compilation problem.
Moreover, GCC 4.9, 5.4 and 7.1 on the same Debian built Release configuration successfully.

I suggest to install other version of GCC or use Clang to build GZDoom.
Alternatively you can comment or remove these lines to be able to build with GCC 6.
Post Reply

Return to “Closed Bugs [GZDoom]”