Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] dxx-rebirth scons C++ -std configure issue
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
kwispy
Tux's lil' helper
Tux's lil' helper


Joined: 10 Mar 2003
Posts: 82

PostPosted: Tue Mar 27, 2018 7:51 pm    Post subject: [SOLVED] dxx-rebirth scons C++ -std configure issue Reply with quote

Hey all! I saw the Gentoo Portage tree cleaner stating my old install of d2x-rebirth was going to be removed shortly, so I attempted to install dxx-rebirth-0.59.100. It fails at the configure/checking step, as if there was something wrong with my GCC:

Code:

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ~] games-action/dxx-rebirth-0.59.100::gentoo  USE="data descent1 descent2 ipv6 music opengl textures -debug -opl3-musicpack -sc55-musicpack" L10N="-de" 0 KiB

Total: 1 package (1 new), Size of downloads: 0 KiB


>>> Verifying ebuild manifests

>>> Emerging (1 of 1) games-action/dxx-rebirth-0.59.100::gentoo
 * dxx-rebirth_v0.59.100-src.tar.gz BLAKE2B SHA512 size ;-) ...                                                                 [ ok ]
 * d1xr-hires.dxa BLAKE2B SHA512 size ;-) ...                                                                                   [ ok ]
>>> Unpacking source...
>>> Unpacking dxx-rebirth_v0.59.100-src.tar.gz to /var/tmp/portage/games-action/dxx-rebirth-0.59.100/work
>>> Unpacking d1xr-hires.dxa to /var/tmp/portage/games-action/dxx-rebirth-0.59.100/work
unpack d1xr-hires.dxa: file format not recognized. Ignoring.
>>> Source unpacked in /var/tmp/portage/games-action/dxx-rebirth-0.59.100/work
>>> Preparing source in /var/tmp/portage/games-action/dxx-rebirth-0.59.100/work/dxx-rebirth_v0.59.100-src ...
 * Applying dxx-rebirth-0.59.100-flags.patch ...                                                                                [ ok ]
 * Applying dxx-rebirth-0.59.100-sharepath.patch ...                                                                            [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/games-action/dxx-rebirth-0.59.100/work/dxx-rebirth_v0.59.100-src ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/games-action/dxx-rebirth-0.59.100/work/dxx-rebirth_v0.59.100-src ...
scons -j21 prefix=/usr d1x=1 d2x=1 debug=0 ipv6=1 opengl=1 sdlmixer=1 verbosebuild=1
scons: Reading SConscript files ...
===== D1X-Rebirth v0.59.100 =====
===== D2X-Rebirth v0.59.100 =====
DXX-Archive.3: compiling on linux2 for linux into .
DXX-Archive.3: checking version of C++ compiler 'x86_64-pc-linux-gnu-g++' ... 'x86_64-pc-linux-gnu-g++ (Gentoo 6.4.0-r1 p1.3) 6.4.0'
DXX-Archive.3: checking path to assembler ... '/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/as'
DXX-Archive.3: checking version of assembler '/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/as' ... 'GNU assembler (Gentoo 2.29.1 p3) 2.29.1'
DXX-Archive.3: checking path to linker ... '/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld'
DXX-Archive.3: checking version of linker '/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld' ... 'GNU ld (Gentoo 2.29.1 p3) 2.29.1'
DXX-Archive.3:   CXX: 'x86_64-pc-linux-gnu-g++'
DXX-Archive.3:   CPPDEFINES: None
DXX-Archive.3:   CPPPATH: ['common/include', 'common/main', '.', '']
DXX-Archive.3:   CPPFLAGS: ['-Wno-sign-compare']
DXX-Archive.3:   CXXFLAGS: ['-ftabstop=4', '-Wall', '-Wshadow', '-Werror=extra', '-Werror=format=2', '-Werror=missing-braces', '-Werror=missing-include-dirs', '-Werror=uninitialized', '-Werror=undef', '-Werror=pointer-arith', '-Werror=cast-qual', '-Werror=missing-declarations', '-Werror=redundant-decls', '-Werror=vla', '-pthread', '-funsigned-char', '-O2', '-pipe', '-march=bdver1', '-mtune=bdver1', '-mno-movbe', '-mno-fma', '-mno-bmi', '-mno-tbm', '--param', 'l1-cache-size=16', '--param', 'l1-cache-line-size=64', '--param', 'l2-cache-size=2048']
DXX-Archive.3:   LIBS: None
DXX-Archive.3:   LINKFLAGS: ['-Wl,-O1', '-Wl,--as-needed']
DXX-Archive.3:   $CCACHE_PREFIX: None
DXX-Archive.3:   $DISTCC_HOSTS: None
DXX-Archive.3: checking whether C++ compiler and linker work...yes
DXX-Archive.3: checking whether C++ compiler accepts -std=gnu++14...no
DXX-Archive.3: checking whether C++ compiler accepts -std=gnu++11...no
[b]scons: *** C++ compiler does not accept any supported C++ -std option.  See sconf.log for details.  Stop.[/b]
 * ERROR: games-action/dxx-rebirth-0.59.100::gentoo failed (compile phase):
 *   escons failed.
 *
 * Call stack:
 *     ebuild.sh, line  124:  Called src_compile
 *   environment, line 2100:  Called escons 'prefix=/usr' 'd1x=1' 'd2x=1' 'debug=0' 'ipv6=1' 'opengl=1' 'sdlmixer=1' 'verbosebuild=1'
 *   environment, line  903:  Called die
 * The specific snippet of code:
 *                   die -n "escons failed."



Since no other packages fail when compiling, and I've been using gcc-6.4.0 for a good many months now, I assume it has something to do with the SConstruct file in the dxx-rebirth_v0.59.100-src.tar.gz archive and how it is checking on my toolchain. Or it is my toolchain... Idk.

Problem with that SConstruct file is it is 4000+ lines long. But I've found calls to implicit_tests.append() with check_cxx11 and check_cxx14 on lines 705, 706. Hmmm.

Just for sanity, I was messing around with g++ (like in this blog post: https://blogs.gentoo.org/blueness/2015/03/10/the-c11-abi-incompatibility-problem-in-gentoo/), and I have no problems with this (I think):
Code:

 $ g++ -x c++ -E -P - <<< __cplusplus
201402L
 $ g++ -x c++ --std=c++98 -E -P - <<< __cplusplus
199711L
 $ g++ -x c++ --std=c++11 -E -P - <<< __cplusplus
201103L


Currently, my system is busy doing:
Code:

revdep-rebuild --library 'libstdc++.so.6' -- --exclude gcc


Hopefully this solves it?
I did just do a large upgrade (250 packages), but again I ran into no problems like this with any other package upgrading.


My system:
Code:

$ emerge --info
Portage 2.3.24 (python 3.5.4-final-0, default/linux/amd64/17.0/desktop/gnome/systemd, gcc-6.4.0, glibc-2.25-r10, 4.14.11-gentoo-r2 x86_64)
=================================================================
System uname: Linux-4.14.11-gentoo-r2-x86_64-AMD_FX-tm-8320_Eight-Core_Processor-with-gentoo-2.4.1
KiB Mem:    12279192 total,   4574420 free
KiB Swap:   18776056 total,  17320696 free
Timestamp of repository gentoo: Tue, 27 Mar 2018 03:30:01 +0000
Head commit of repository gentoo: cee1a944332dc31322c22fa474e2c15206165352
sh bash 4.4_p12
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.4.5-r1::gentoo, 3.5.4-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.15.1-r2::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            6.4.0-r1::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r10::gentoo

...

ABI="amd64"
ABI_X86="64"
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
ACCEPT_PROPERTIES="*"
ACCEPT_RESTRICT="*"

...

ARCH="amd64"

...

CFLAGS="-O2 -pipe -march=bdver1 -mtune=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-tbm --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048"
CFLAGS_amd64="-m64"
CFLAGS_x32="-mx32"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x32="x86_64-pc-linux-gnux32"
CHOST_x86="i686-pc-linux-gnu"


Last edited by kwispy on Wed Mar 28, 2018 2:22 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21489

PostPosted: Wed Mar 28, 2018 1:27 am    Post subject: Re: dxx-rebirth scons C++ -std configure issue Reply with quote

kwispy wrote:
Code:
DXX-Archive.3:   CXX: 'x86_64-pc-linux-gnu-g++'
DXX-Archive.3: checking whether C++ compiler and linker work...yes
DXX-Archive.3: checking whether C++ compiler accepts -std=gnu++14...no
DXX-Archive.3: checking whether C++ compiler accepts -std=gnu++11...no
scons: *** C++ compiler does not accept any supported C++ -std option.  See sconf.log for details.  Stop.
 * ERROR: games-action/dxx-rebirth-0.59.100::gentoo failed (compile phase):
Whenever an upstream build system writes a log and mentions it in output, please pastebin that log. They usually write logs for good reason. :) In this case, we need sconf.log. It's probably either in the root of the source directory or the root of the build directory (if different).
kwispy wrote:
I have no problems with this (I think):
Code:
 $ g++ -x c++ -E -P - <<< __cplusplus
201402L
 $ g++ -x c++ --std=c++98 -E -P - <<< __cplusplus
199711L
 $ g++ -x c++ --std=c++11 -E -P - <<< __cplusplus
201103L
This was a good thought, but based on the output, it's not quite the right test. First, the package is using the CHOST-qualified name x86_64-pc-linux-gnu-g++, but you used a bare g++. These are probably equivalent, but it'd be better to match upstream's test exactly. Second, and more importantly, upstream tested options -std=gnu++14 and -std=gnu++11. You tested neither. Also, it's possible that upstream is testing some specific program with those options. You tested that the preprocessor produces a sane value for __cplusplus, but not whether any particular program can be compiled. Seeing the contents of that log would likely tell us more.
Back to top
View user's profile Send private message
kwispy
Tux's lil' helper
Tux's lil' helper


Joined: 10 Mar 2003
Posts: 82

PostPosted: Wed Mar 28, 2018 2:22 am    Post subject: Reply with quote

Thanks for the reply and the tips. It seems I found the culprit.

I found sconf.log in the work directory. https://pastebin.com/qWizr7wC
Some odd tests, especially the comments about them always being false. (lines 73 and 105)

BUT the thing that was causing scons to choke was actually my CFLAGS, sorry to say :oops:

Code:

CFLAGS="-O2 -pipe -march=bdver1 -mtune=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-tbm --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048"


The last lines of sconf.log give it away:
Code:

x86_64-pc-linux-gnu-g++ -c -ftabstop=4 -Wall -Wshadow -Werror=extra -Werror=format=2 -Werror=missing-braces -Werror=missing-include-dirs -Werror=uninitialized -Werror=undef -Werror=pointer-arith -Werror=cast-qual -Werror=missing-declarations -Werror=redundant-decls -Werror=vla -pthread -funsigned-char -O2 -pipe -march=bdver1 -mtune=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-tbm l1-cache-size=16 l1-cache-line-size=64 --param l2-cache-size=2048 -std=gnu++11 -Werror -Wno-sign-compare -Icommon/include -Icommon/main -I. .sconf_temp/conftest_2.cpp -o .sconf_temp/conftest_2.o
x86_64-pc-linux-gnu-g++: error: l1-cache-size=16: No such file or directory
x86_64-pc-linux-gnu-g++: error: l1-cache-line-size=64: No such file or directory
scons: Configure: no


Commenting out those cache size parameters in my CFLAGS did the trick. I'm not sure where I found those, but it looks like g++ only has a problem with the L1, not the L2. Weird. They've been that way for who knows how long, probably years.

I guess I should also follow this https://wiki.gentoo.org/wiki/Safe_CFLAGS and take out all those weird optimizations, and set it to:
Code:

CFLAGS="-O2 -march=bdver1 -pipe"
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21489

PostPosted: Wed Mar 28, 2018 3:43 am    Post subject: Reply with quote

Those CFLAGS look fine to me (though you should look at CXXFLAGS, since this is a C++ program). Your quoted CFLAGS match what the program output, but not how it invoked the compiler. I think your flags are valid and this is a case of SCons issue #3017: Mis-processing of GCC flags "--param arg1=val1 --param arg2=val2". It is strange that the earlier test for "compiler and linker work" succeeded, but this test failed. Removing the --param is probably the best workaround you can make. Since it's an SCons problem, I don't think Rebirth upstream can fix this. They're trusting the build tool to do the right thing, and in this case, it didn't.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum