tsee / extutils-cppguess

Guess the C++ compiler for Perl modules
6 stars 9 forks source link

0.24 regression in Fedora build system (Boost::Geometry::Utils, slic3r): Missing -xc++ #26

Closed hroncok closed 2 years ago

hroncok commented 2 years ago

Hello,

with the update to 0.24, we see a regression in at least 2 dependent packages of this and in the tests of this library itself.

The environment

Our build system sets:

+ umask 022
+ cd /builddir/build/BUILD
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CFLAGS
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CXXFLAGS
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FCFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/ExtUtils-CppGuess-0.24/.package_note-perl-ExtUtils-CppGuess-0.24-1.fc37.x86_64.ld'
+ export LDFLAGS
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ export LT_SYS_LIBRARY_PATH
+ CC=gcc
+ export CC
+ CXX=g++
+ export CXX

The test failure

And we get:

+ /usr/bin/make -O -j8 V=1 VERBOSE=1 test
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-report-prereqs.t .. ok
t/001_load.t ........... ok
t/002_icpp.t ........... 
Dubious, test returned 9 (wstat 2304, 0x900)
Failed 9/9 subtests 
t/003_standard_flag.t .. ok
t/004_env.t ............ ok
t/010_module_build.t ... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 
t/011_makemaker.t ...... ok

Test Summary Report
-------------------
t/002_icpp.t         (Wstat: 2304 (exited 9) Tests: 9 Failed: 9)
  Failed tests:  1-9
  Non-zero exit status: 9
t/010_module_build.t (Wstat: 256 (exited 1) Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=7, Tests=21,  2 wallclock secs ( 0.02 usr  0.00 sys +  2.17 cusr  0.40 csys =  2.59 CPU)
Result: FAIL

RPM build errors:
# 
# Versions for all modules listed in MYMETA.json (including optional ones):
# 
# === Configure Requires ===
# 
#     Module              Want Have Where                        Howbig
#     ------------------- ---- ---- ---------------------------- ------
#     ExtUtils::MakeMaker  any 7.64 /usr/share/perl5/vendor_perl 111821
# 
# === Build Requires ===
# 
#     Module              Want Have Where                        Howbig
#     ------------------- ---- ---- ---------------------------- ------
#     ExtUtils::MakeMaker  any 7.64 /usr/share/perl5/vendor_perl 111821
# 
# === Test Requires ===
# 
#     Module                  Want     Have Where                        Howbig
#     ------------------- -------- -------- ---------------------------- ------
#     Capture::Tiny            any     0.48 /usr/share/perl5              29656
#     Cwd                      any     3.80 /usr/lib64/perl5/vendor_perl  21942
#     ExtUtils::CBuilder  0.280231 0.280236 /usr/share/perl5/vendor_perl   8884
#     ExtUtils::MakeMaker      any     7.64 /usr/share/perl5/vendor_perl 111821
#     ExtUtils::Manifest       any     1.73 /usr/share/perl5/vendor_perl  23491
#     Fatal                    any     2.34 /usr/share/perl5/vendor_perl  59085
#     Module::Build            any   0.4231 /usr/share/perl5/vendor_perl  35409
#     Test::More              0.88 1.302190 /usr/share/perl5/vendor_perl  52979
# 
# === Runtime Requires ===
# 
#     Module            Want   Have Where                        Howbig
#     ----------------- ---- ------ ---------------------------- ------
#     Capture::Tiny      any   0.48 /usr/share/perl5              29656
#     ExtUtils::ParseXS 3.35   3.44 /usr/share/perl5/vendor_perl  67178
#     File::Basename     any   2.85 /usr/share/perl5              11194
#     File::Spec         any   3.80 /usr/lib64/perl5/vendor_perl  10571
#     File::Temp         any 0.2311 /usr/share/perl5/vendor_perl 118877
# 
# EUMM:{
#   'CC' => 'g++',
#   'CCFLAGS' => ' -D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection',
#   'dynamic_lib' => {
#     'OTHERLDFLAGS' => ' -lstdc++'
#   }
# }
# ---
# MB:{
#   'config' => {
#     'cc' => 'g++'
#   },
#   'extra_compiler_flags' => ' -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection',
#   'extra_linker_flags' => ' -lstdc++'
# }
# ---
# Config:{
#   'byacc' => 'byacc',
#   'cc' => 'gcc',
#   'cccdlflags' => '-fPIC',
#   'ccdlflags' => '-Wl,--enable-new-dtags -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ',
#   'ccflags' => '-D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
#   'ccflags_nolargefiles' => '-D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include ',
#   'ccflags_uselargefiles' => '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
#   'ccname' => 'gcc',
#   'ccstdflags' => ' -std=c89',
#   'ccsymbols' => '',
#   'ccversion' => '',
#   'ccwarnflags' => ' -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings -Werror=declaration-after-statement',
#   'cppccsymbols' => '',
#   'd_PRIEUldbl' => 'define',
#   'd_PRIFUldbl' => 'define',
#   'd_PRIGUldbl' => 'define',
#   'd_PRIeldbl' => 'define',
#   'd_PRIfldbl' => 'define',
#   'd_PRIgldbl' => 'define',
#   'd_SCNfldbl' => 'define',
#   'd_accept4' => 'define',
#   'd_access' => 'define',
#   'd_accessx' => undef,
#   'd_eaccess' => 'define',
#   'd_ldbl_dig' => 'define',
#   'd_ldexpl' => 'define',
#   'd_locconv' => 'define',
#   'd_old_pthread_create_joinable' => undef,
#   'd_oldpthreads' => undef,
#   'd_oldsock' => undef,
#   'd_pthread_yield' => 'define',
#   'd_sched_yield' => 'define',
#   'd_setlocale_accepts_any_locale_name' => undef,
#   'd_strtold' => 'define',
#   'd_strtold_l' => 'define',
#   'd_telldir' => 'define',
#   'd_telldirproto' => 'define',
#   'gccansipedantic' => '',
#   'gccosandvers' => '',
#   'gccversion' => '12.0.1 20220308 (Red Hat 12.0.1-0)',
#   'i_sysaccess' => undef,
#   'ld' => 'gcc',
#   'ld_can_script' => 'define',
#   'lddlflags' => '-lpthread -shared -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1  -L/usr/local/lib -fstack-protector-strong',
#   'ldflags' => '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1  -fstack-protector-strong -L/usr/local/lib',
#   'ldflags_nolargefiles' => '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1  -fstack-protector-strong -L/usr/local/lib',
#   'ldflags_uselargefiles' => '',
#   'ldlibpthname' => 'LD_LIBRARY_PATH',
#   'old_pthread_create_joinable' => '',
#   'sPRIEUldbl' => '"LE"',
#   'sPRIFUldbl' => '"LF"',
#   'sPRIGUldbl' => '"LG"',
#   'sPRIeldbl' => '"Le"',
#   'sPRIfldbl' => '"Lf"',
#   'sPRIgldbl' => '"Lg"',
#   'sSCNfldbl' => '"Lf"',
#   'sched_yield' => 'sched_yield()',
#   'yacc' => 'yacc',
#   'yaccflags' => ''
# }
# Method: is_sunstudio = 0
# Method: is_msvc = undef
# Method: is_gcc = 1
# Method: is_clang = 0
# Method: compiler_command = g++ -D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
# Method: linker_flags = -lstdc++
# Method: iostream_fname = iostream
# Method: cpp_flavor_defs = 
# #define __INLINE_CPP_STANDARD_HEADERS 1
# #define __INLINE_CPP_NAMESPACE_STD 1
# 

#   Failed test at t/002_icpp.t line 102.
#     Structures begin differing at:
#          $got->{compiler_command} = 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
#     $expected->{compiler_command} = 'cl -TP -EHsc'
# [
#   {
#     'cc' => 'cl',
#     'config' => {
#       'ccflags' => ''
#     },
#     'os' => 'MSWin32'
#   },
#   {
#     'compiler_command' => 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection',
#     'is_clang' => 0,
#     'is_gcc' => 0,
#     'is_msvc' => 1,
#     'is_sunstudio' => 0,
#     'linker_flags' => 'msvcprt.lib'
#   },
#   {
#     'compiler_command' => 'cl -TP -EHsc',
#     'is_clang' => 0,
#     'is_gcc' => 0,
#     'is_msvc' => 1,
#     'is_sunstudio' => 0,
#     'linker_flags' => 'msvcprt.lib'
#   }
# ]

#   Failed test at t/002_icpp.t line 102.
#     Structures begin differing at:
#          $got->{compiler_command} = 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
#     $expected->{compiler_command} = 'g++ -xc++'
# [
#   {
#     'cc' => 'gcc',
#     'config' => {
#       'ccflags' => '',
#       'ldflags' => ''
#     },
#     'os' => 'MSWin32'
#   },
#   {
#     'compiler_command' => 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection',
#     'is_clang' => 0,
#     'is_gcc' => 1,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => '-lstdc++'
#   },
#   {
#     'compiler_command' => 'g++ -xc++',
#     'is_clang' => 0,
#     'is_gcc' => 1,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => '-lstdc++'
#   }
# ]

#   Failed test at t/002_icpp.t line 102.
#     Structures begin differing at:
#          $got->{compiler_command} = 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
#     $expected->{compiler_command} = 'g++ -xc++'
# [
#   {
#     'cc' => 'gcc',
#     'config' => {
#       'ccflags' => '',
#       'ldflags' => 'static-libstdc++'
#     },
#     'os' => 'MSWin32'
#   },
#   {
#     'compiler_command' => 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection',
#     'is_clang' => 0,
#     'is_gcc' => 1,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => ''
#   },
#   {
#     'compiler_command' => 'g++ -xc++',
#     'is_clang' => 0,
#     'is_gcc' => 1,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => ''
#   }
# ]

#   Failed test at t/002_icpp.t line 102.
#     Structures begin differing at:
#          $got->{compiler_command} = 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
#     $expected->{compiler_command} = 'g++ -xc++'
# [
#   {
#     'cc' => 'gcc',
#     'config' => {
#       'ccflags' => ''
#     },
#     'os' => 'freebsd',
#     'osvers' => 9
#   },
#   {
#     'compiler_command' => 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection',
#     'is_clang' => 0,
#     'is_gcc' => 1,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => '-lstdc++'
#   },
#   {
#     'compiler_command' => 'g++ -xc++',
#     'is_clang' => 0,
#     'is_gcc' => 1,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => '-lstdc++'
#   }
# ]

#   Failed test at t/002_icpp.t line 102.
#     Structures begin differing at:
#          $got->{compiler_command} = 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wno-reserved-user-defined-literal'
#     $expected->{compiler_command} = 'clang++ -Wno-reserved-user-defined-literal'
# [
#   {
#     'cc' => 'gcc',
#     'config' => {
#       'ccflags' => '',
#       'gccversion' => 'Clang'
#     },
#     'os' => 'freebsd',
#     'osvers' => 10
#   },
#   {
#     'compiler_command' => 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wno-reserved-user-defined-literal',
#     'is_clang' => 1,
#     'is_gcc' => undef,
#     'is_msvc' => undef,
#     'is_sunstudio' => undef,
#     'linker_flags' => '-lc++'
#   },
#   {
#     'compiler_command' => 'clang++ -Wno-reserved-user-defined-literal',
#     'is_clang' => 1,
#     'is_gcc' => undef,
#     'is_msvc' => undef,
#     'is_sunstudio' => undef,
#     'linker_flags' => '-lc++'
#   }
# ]

#   Failed test at t/002_icpp.t line 102.
#     Structures begin differing at:
#          $got->{compiler_command} = 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
#     $expected->{compiler_command} = 'g++ -xc++'
# [
#   {
#     'cc' => 'gcc',
#     'config' => {
#       'ccflags' => ''
#     },
#     'os' => 'netbsd'
#   },
#   {
#     'compiler_command' => 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection',
#     'is_clang' => 0,
#     'is_gcc' => 1,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => '-lstdc++ -lgcc_s'
#   },
#   {
#     'compiler_command' => 'g++ -xc++',
#     'is_clang' => 0,
#     'is_gcc' => 1,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => '-lstdc++ -lgcc_s'
#   }
# ]

#   Failed test at t/002_icpp.t line 102.
#     Structures begin differing at:
#          $got->{compiler_command} = 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wno-reserved-user-defined-literal'
#     $expected->{compiler_command} = 'clang++ -xc++ -Wno-reserved-user-defined-literal'
# [
#   {
#     'cc' => 'clang',
#     'config' => {
#       'ccflags' => '',
#       'gccversion' => 'Clang'
#     },
#     'os' => 'linux'
#   },
#   {
#     'compiler_command' => 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wno-reserved-user-defined-literal',
#     'is_clang' => 1,
#     'is_gcc' => undef,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => '-lstdc++'
#   },
#   {
#     'compiler_command' => 'clang++ -xc++ -Wno-reserved-user-defined-literal',
#     'is_clang' => 1,
#     'is_gcc' => undef,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => '-lstdc++'
#   }
# ]

#   Failed test at t/002_icpp.t line 102.
#     Structures begin differing at:
#          $got->{compiler_command} = 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
#     $expected->{compiler_command} = 'g++ -xc++'
# [
#   {
#     'cc' => 'gcc',
#     'config' => {
#       'ccflags' => ''
#     },
#     'os' => 'linux'
#   },
#   {
#     'compiler_command' => 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection',
#     'is_clang' => 0,
#     'is_gcc' => 1,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => '-lstdc++'
#   },
#   {
#     'compiler_command' => 'g++ -xc++',
#     'is_clang' => 0,
#     'is_gcc' => 1,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => '-lstdc++'
#   }
# ]

#   Failed test at t/002_icpp.t line 102.
#     Structures begin differing at:
#          $got->{compiler_command} = 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
#     $expected->{compiler_command} = 'CC'
# [
#   {
#     'cc' => '/opt/SUNWspro/bin/cc',
#     'config' => {
#       'ccflags' => ''
#     },
#     'os' => 'linux'
#   },
#   {
#     'compiler_command' => 'g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection',
#     'is_clang' => undef,
#     'is_gcc' => undef,
#     'is_msvc' => undef,
#     'is_sunstudio' => 1,
#     'linker_flags' => ''
#   },
#   {
#     'compiler_command' => 'CC',
#     'is_clang' => undef,
#     'is_gcc' => undef,
#     'is_msvc' => undef,
#     'is_sunstudio' => 1,
#     'linker_flags' => ''
#   }
# ]
# Looks like you failed 9 tests of 9.
cc1plus: error: unrecognized command-line option '-std=c++unreal'
# EUMM env:{
#   'CC' => 'czz',
#   'CCFLAGS' => ' -D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 flag',
#   'dynamic_lib' => {
#     'OTHERLDFLAGS' => ' ldflag'
#   }
# }
# Module::Build version: 0.4231
# ExtUtils::CBuilder version: 0.280236

#   Failed test 'build with Module::Build'
#   at t/010_module_build.t line 19.
# Build.PL output
# ========================================
# Created MYMETA.yml and MYMETA.json
# Creating new 'Build' script for 'CppGuessTest' version '0.01'
# ========================================
# Build output
# ========================================
# Building CppGuessTest
# gcc -I/usr/lib64/perl5/CORE -DVERSION="0.01" -DXS_VERSION="0.01" -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -DINCLUDE_DOT=0 -c -D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -g -o lib/CppGuessTest.o lib/CppGuessTest.c
# lib/CppGuessTest.xs:12:10: fatal error: string: No such file or directory
#    12 | #include <string>
#       |          ^~~~~~~~
# compilation terminated.
# error building lib/CppGuessTest.o from 'lib/CppGuessTest.c' at /usr/share/perl5/vendor_perl/ExtUtils/CBuilder/Base.pm line 186.
# ========================================
# Looks like you failed 1 test of 1.
Failed 2/7 test programs. 10/21 subtests failed.
make: *** [Makefile:856: test_dynamic] Error 255

At first, I assumed the tests simply cannot run in an environment, where the environment variables are set, so I've done:

unset -v CC CXX CFLAGS CXXFLAGS LDFLAGS

Before running the tests, but that was not a good idea, this affected dependent packages.

The dependent packages problem

E.g. when we build perl-Boost-Geometry-Utils we set the flags similarly. With the previous version (0.23), the build happened as:

gcc -I/usr/lib64/perl5/CORE -DVERSION="0.15" -DXS_VERSION="0.15" -fPIC -xc++ -DHAS_BOOL -Isrc -Ibuildtmp -c -D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -g -o buildtmp/Utils.o buildtmp/Utils.c

Now it builds as:

gcc -I/usr/lib64/perl5/CORE -DVERSION="0.15" -DXS_VERSION="0.15" -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -DHAS_BOOL -Isrc -Ibuildtmp -c -D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -g -o buildtmp/Utils.o buildtmp/Utils.c

The error in compilation is:

buildtmp/main.xs:5:10: fatal error: cstring: No such file or directory
    5 | #include <cstring>
      |          ^~~~~~~~~
compilation terminated.

Diff of the individual flags:

@@ -3,7 +3,25 @@
 -DVERSION="0.15"
 -DXS_VERSION="0.15"
 -fPIC
--xc++
+-O2
+-flto=auto
+-ffat-lto-objects
+-fexceptions
+-g
+-grecord-gcc-switches
+-pipe
+-Wall
+-Werror=format-security
+-Wp,-D_FORTIFY_SOURCE=2
+-Wp,-D_GLIBCXX_ASSERTIONS
+-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
+-fstack-protector-strong
+-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1
+-m64
+-mtune=generic
+-fasynchronous-unwind-tables
+-fstack-clash-protection
+-fcf-protection
 -DHAS_BOOL
 -Isrc
 -Ibuildtmp

sic3r has a similar problem.

I think the missing -xc++ is a problem. But I am not sure, I don't do much Perl unfortunately, I maintain this in Fedora only because of slic3r.

mohawk2 commented 2 years ago

Thanks for the report! It seems my good idea caused chaos. Sorry about that.

mohawk2 commented 2 years ago

Released as 0.25.

hroncok commented 2 years ago

Unfortunately, this still doesn't pass the tests in Fedora:

+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CFLAGS
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CXXFLAGS
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FCFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/ExtUtils-CppGuess-0.25/.package_note-perl-ExtUtils-CppGuess-0.25-1.fc37.x86_64.ld'
+ export LDFLAGS
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ export LT_SYS_LIBRARY_PATH
+ CC=gcc
+ export CC
+ CXX=g++
+ export CXX
...
+ /usr/bin/make -O -j8 V=1 VERBOSE=1 test
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-report-prereqs.t .. ok
t/001_load.t ........... ok
t/002_icpp.t ........... 
Dubious, test returned 4 (wstat 1024, 0x400)
Failed 4/9 subtests 
t/003_standard_flag.t .. ok
t/004_env.t ............ ok
t/010_module_build.t ... ok
t/011_makemaker.t ...... ok

Test Summary Report
-------------------
t/002_icpp.t         (Wstat: 1024 (exited 4) Tests: 9 Failed: 4)
  Failed tests:  1, 5, 7, 9
  Non-zero exit status: 4
Files=7, Tests=20,  4 wallclock secs ( 0.02 usr  0.01 sys +  3.23 cusr  0.60 csys =  3.86 CPU)
Result: FAIL

RPM build errors:
# 
# Versions for all modules listed in MYMETA.json (including optional ones):
# 
# === Configure Requires ===
# 
#     Module              Want Have Where                        Howbig
#     ------------------- ---- ---- ---------------------------- ------
#     ExtUtils::MakeMaker  any 7.64 /usr/share/perl5/vendor_perl 111821
# 
# === Build Requires ===
# 
#     Module              Want Have Where                        Howbig
#     ------------------- ---- ---- ---------------------------- ------
#     ExtUtils::MakeMaker  any 7.64 /usr/share/perl5/vendor_perl 111821
# 
# === Test Requires ===
# 
#     Module                  Want     Have Where                        Howbig
#     ------------------- -------- -------- ---------------------------- ------
#     Capture::Tiny            any     0.48 /usr/share/perl5              29656
#     Cwd                      any     3.80 /usr/lib64/perl5/vendor_perl  21942
#     ExtUtils::CBuilder  0.280231 0.280236 /usr/share/perl5/vendor_perl   8884
#     ExtUtils::MakeMaker      any     7.64 /usr/share/perl5/vendor_perl 111821
#     ExtUtils::Manifest       any     1.73 /usr/share/perl5/vendor_perl  23491
#     Fatal                    any     2.34 /usr/share/perl5/vendor_perl  59085
#     Module::Build            any   0.4231 /usr/share/perl5/vendor_perl  35409
#     Test::More              0.88 1.302190 /usr/share/perl5/vendor_perl  52979
# 
# === Runtime Requires ===
# 
#     Module            Want   Have Where                        Howbig
#     ----------------- ---- ------ ---------------------------- ------
#     Capture::Tiny      any   0.48 /usr/share/perl5              29656
#     ExtUtils::ParseXS 3.35   3.44 /usr/share/perl5/vendor_perl  67178
#     File::Basename     any   2.85 /usr/share/perl5              11194
#     File::Spec         any   3.80 /usr/lib64/perl5/vendor_perl  10571
#     File::Temp         any 0.2311 /usr/share/perl5/vendor_perl 118877
# 
# EUMM:{
#   'CC' => 'g++',
#   'CCFLAGS' => ' -D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xc++',
#   'dynamic_lib' => {
#     'OTHERLDFLAGS' => ' -lstdc++'
#   }
# }
# ---
# MB:{
#   'config' => {
#     'cc' => 'g++'
#   },
#   'extra_compiler_flags' => ' -xc++',
#   'extra_linker_flags' => ' -lstdc++'
# }
# ---
# Config:{
#   'byacc' => 'byacc',
#   'cc' => 'gcc',
#   'cccdlflags' => '-fPIC',
#   'ccdlflags' => '-Wl,--enable-new-dtags -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ',
#   'ccflags' => '-D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
#   'ccflags_nolargefiles' => '-D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include ',
#   'ccflags_uselargefiles' => '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
#   'ccname' => 'gcc',
#   'ccstdflags' => ' -std=c89',
#   'ccsymbols' => '',
#   'ccversion' => '',
#   'ccwarnflags' => ' -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings -Werror=declaration-after-statement',
#   'cppccsymbols' => '',
#   'd_PRIEUldbl' => 'define',
#   'd_PRIFUldbl' => 'define',
#   'd_PRIGUldbl' => 'define',
#   'd_PRIeldbl' => 'define',
#   'd_PRIfldbl' => 'define',
#   'd_PRIgldbl' => 'define',
#   'd_SCNfldbl' => 'define',
#   'd_accept4' => 'define',
#   'd_access' => 'define',
#   'd_accessx' => undef,
#   'd_eaccess' => 'define',
#   'd_ldbl_dig' => 'define',
#   'd_ldexpl' => 'define',
#   'd_locconv' => 'define',
#   'd_old_pthread_create_joinable' => undef,
#   'd_oldpthreads' => undef,
#   'd_oldsock' => undef,
#   'd_pthread_yield' => 'define',
#   'd_sched_yield' => 'define',
#   'd_setlocale_accepts_any_locale_name' => undef,
#   'd_strtold' => 'define',
#   'd_strtold_l' => 'define',
#   'd_telldir' => 'define',
#   'd_telldirproto' => 'define',
#   'gccansipedantic' => '',
#   'gccosandvers' => '',
#   'gccversion' => '12.0.1 20220308 (Red Hat 12.0.1-0)',
#   'i_sysaccess' => undef,
#   'ld' => 'gcc',
#   'ld_can_script' => 'define',
#   'lddlflags' => '-lpthread -shared -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1  -L/usr/local/lib -fstack-protector-strong',
#   'ldflags' => '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1  -fstack-protector-strong -L/usr/local/lib',
#   'ldflags_nolargefiles' => '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1  -fstack-protector-strong -L/usr/local/lib',
#   'ldflags_uselargefiles' => '',
#   'ldlibpthname' => 'LD_LIBRARY_PATH',
#   'old_pthread_create_joinable' => '',
#   'sPRIEUldbl' => '"LE"',
#   'sPRIFUldbl' => '"LF"',
#   'sPRIGUldbl' => '"LG"',
#   'sPRIeldbl' => '"Le"',
#   'sPRIfldbl' => '"Lf"',
#   'sPRIgldbl' => '"Lg"',
#   'sSCNfldbl' => '"Lf"',
#   'sched_yield' => 'sched_yield()',
#   'yacc' => 'yacc',
#   'yaccflags' => ''
# }
# Method: is_sunstudio = 0
# Method: is_msvc = undef
# Method: is_gcc = 1
# Method: is_clang = 0
# Method: compiler_command = g++ -D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xc++
# Method: linker_flags = -lstdc++
# Method: iostream_fname = iostream
# Method: cpp_flavor_defs = 
# #define __INLINE_CPP_STANDARD_HEADERS 1
# #define __INLINE_CPP_NAMESPACE_STD 1
# 

#   Failed test at t/002_icpp.t line 102.
#     Structures begin differing at:
#          $got->{compiler_command} = 'g++ -TP -EHsc'
#     $expected->{compiler_command} = 'cl -TP -EHsc'
# [
#   {
#     'cc' => 'cl',
#     'config' => {
#       'ccflags' => ''
#     },
#     'os' => 'MSWin32'
#   },
#   {
#     'compiler_command' => 'g++ -TP -EHsc',
#     'is_clang' => 0,
#     'is_gcc' => 0,
#     'is_msvc' => 1,
#     'is_sunstudio' => 0,
#     'linker_flags' => 'msvcprt.lib'
#   },
#   {
#     'compiler_command' => 'cl -TP -EHsc',
#     'is_clang' => 0,
#     'is_gcc' => 0,
#     'is_msvc' => 1,
#     'is_sunstudio' => 0,
#     'linker_flags' => 'msvcprt.lib'
#   }
# ]

#   Failed test at t/002_icpp.t line 102.
#     Structures begin differing at:
#          $got->{compiler_command} = 'g++ -Wno-reserved-user-defined-literal'
#     $expected->{compiler_command} = 'clang++ -Wno-reserved-user-defined-literal'
# [
#   {
#     'cc' => 'gcc',
#     'config' => {
#       'ccflags' => '',
#       'gccversion' => 'Clang'
#     },
#     'os' => 'freebsd',
#     'osvers' => 10
#   },
#   {
#     'compiler_command' => 'g++ -Wno-reserved-user-defined-literal',
#     'is_clang' => 1,
#     'is_gcc' => undef,
#     'is_msvc' => undef,
#     'is_sunstudio' => undef,
#     'linker_flags' => '-lc++'
#   },
#   {
#     'compiler_command' => 'clang++ -Wno-reserved-user-defined-literal',
#     'is_clang' => 1,
#     'is_gcc' => undef,
#     'is_msvc' => undef,
#     'is_sunstudio' => undef,
#     'linker_flags' => '-lc++'
#   }
# ]

#   Failed test at t/002_icpp.t line 102.
#     Structures begin differing at:
#          $got->{compiler_command} = 'g++ -xc++ -Wno-reserved-user-defined-literal'
#     $expected->{compiler_command} = 'clang++ -xc++ -Wno-reserved-user-defined-literal'
# [
#   {
#     'cc' => 'clang',
#     'config' => {
#       'ccflags' => '',
#       'gccversion' => 'Clang'
#     },
#     'os' => 'linux'
#   },
#   {
#     'compiler_command' => 'g++ -xc++ -Wno-reserved-user-defined-literal',
#     'is_clang' => 1,
#     'is_gcc' => undef,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => '-lstdc++'
#   },
#   {
#     'compiler_command' => 'clang++ -xc++ -Wno-reserved-user-defined-literal',
#     'is_clang' => 1,
#     'is_gcc' => undef,
#     'is_msvc' => undef,
#     'is_sunstudio' => 0,
#     'linker_flags' => '-lstdc++'
#   }
# ]

#   Failed test at t/002_icpp.t line 102.
#     Structures begin differing at:
#          $got->{compiler_command} = 'g++'
#     $expected->{compiler_command} = 'CC'
# [
#   {
#     'cc' => '/opt/SUNWspro/bin/cc',
#     'config' => {
#       'ccflags' => ''
#     },
#     'os' => 'linux'
#   },
#   {
#     'compiler_command' => 'g++',
#     'is_clang' => undef,
#     'is_gcc' => undef,
#     'is_msvc' => undef,
#     'is_sunstudio' => 1,
#     'linker_flags' => ''
#   },
#   {
#     'compiler_command' => 'CC',
#     'is_clang' => undef,
#     'is_gcc' => undef,
#     'is_msvc' => undef,
#     'is_sunstudio' => 1,
#     'linker_flags' => ''
#   }
# ]
# Looks like you failed 4 tests of 9.
cc1plus: error: unrecognized command-line option '-std=c++unreal'
# EUMM env:{
#   'CC' => 'czz',
#   'CCFLAGS' => ' -D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xc++',
#   'dynamic_lib' => {
#     'OTHERLDFLAGS' => ' -lstdc++'
#   }
# }
# Module::Build version: 0.4231
# ExtUtils::CBuilder version: 0.280236
Failed 1/7 test programs. 4/20 subtests failed.
make: *** [Makefile:856: test_dynamic] Error 255

BTW no need to release a new version immediately I can test a pull request before it is merged.

mohawk2 commented 2 years ago

@hroncok Can you try editing t/002_icpp.t and putting BEGIN { delete $ENV{CXX} } at the top and re-running it?

hroncok commented 2 years ago

That makes the actual tests pass, I will now try to build Boost::Geometry::Utils and slic3r

mohawk2 commented 2 years ago

Great! Looking forward to seeing if it actually works ;-)

hroncok commented 2 years ago

Yes! 0.25 actually works now, it was only the test that was not isolated enough. Thanks!

mohawk2 commented 2 years ago

Thank you for the help! Released as 0.26.