tsee / extutils-cppguess

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

0.12 test failure: undefined symbol #17

Closed 0-wiz-0 closed 5 years ago

0-wiz-0 commented 7 years ago

When running the self tests for the 0.12 distfile from cpan for the pkgsrc package with perl-5.26.1, I see:

===> Testing for p5-ExtUtils-CppGuess-0.12
PERL_DL_NONLAZY=1 "/usr/pkg/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/001_load.t .......... 1/2 # EUMM:$VAR1 = {
#           'dynamic_lib' => {
#                              'OTHERLDFLAGS' => ' -lstdc++  -lgcc_s'
#                            },
#           'CCFLAGS' => ' -O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong  -xc++ '
#         };
# ---
# MB:$VAR1 = {
#           'extra_compiler_flags' => ' -O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong  -xc++ ',
#           'extra_linker_flags' => ' -lstdc++  -lgcc_s'
#         };
t/001_load.t .......... ok
t/010_module_build.t .. ok
t/011_makemaker.t ..... 1/1
#   Failed test 'build with ExtUtils::MakeMaker'
#   at t/011_makemaker.t line 13.
# Makefile.PL output
# ========================================
# Checking if your kit is complete...
# Looks good
# Generating a Unix-style Makefile
# Writing Makefile for CppGuessTest
# Writing MYMETA.yml and MYMETA.json
# ========================================
# make output
# ========================================
# cp lib/CppGuessTest.pm blib/lib/CppGuessTest.pm
# Running Mkbootstrap for CppGuessTest ()
# chmod 644 "CppGuessTest.bs"
# "/usr/pkg/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- CppGuessTest.bs blib/arch/auto/CppGuessTest/CppGuessTest.bs 644
# "/usr/pkg/bin/perl" "/usr/pkg/lib/perl5/5.26.0/ExtUtils/xsubpp"  -typemap '/usr/pkg/lib/perl5/5.26.0/ExtUtils/typemap' -typemap '/scratch/devel/p5-ExtUtils-CppGuess/work/ExtUtils-CppGuess-0.12/t/makemaker/typemap'  CppGuessTest.xs > CppGuessTest.xsc
# mv CppGuessTest.xsc CppGuessTest.c
# gcc -c    -O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong  -xc++ -O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -I/usr/include  -g   -I/usr/include    -DVERSION=\"0.01\"  -DXS_VERSION=\"0.01\" -DPIC -fPIC "-I/usr/pkg/lib/perl5/5.26.0/x86_64-netbsd-thread-multi/CORE"   CppGuessTest.c
# rm -f blib/arch/auto/CppGuessTest/CppGuessTest.so
# gcc  -shared  -Wl,-z,relro -Wl,-z,now -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -fstack-protector-strong CppGuessTest.o -Wl,-z,relro -Wl,-z,now  -L/usr/pkg/lib -Wl,-R/usr/pkg/lib/perl5/5.26.0/x86_64-netbsd-thread-multi/CORE -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -o blib/arch/auto/CppGuessTest/CppGuessTest.so     "-L/usr/pkg/lib/perl5/5.26.0/x86_64-netbsd-thread-multi/CORE" "-Wl,-R/usr/pkg/lib/perl5/5.26.0/x86_64-netbsd-thread-multi/CORE" "-Wl,-R/usr/pkg/lib/perl5/5.26.0/x86_64-netbsd-thread-multi/CORE" -lperl
# chmod 755 blib/arch/auto/CppGuessTest/CppGuessTest.so
# ========================================
# make test output
# ========================================
# "/usr/pkg/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- CppGuessTest.bs blib/arch/auto/CppGuessTest/CppGuessTest.bs 644
# PERL_DL_NONLAZY=1 "/usr/pkg/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
#
# #   Failed test 'use CppGuessTest;'
# #   at t/001_load.t line 6.
# #     Tried to use 'CppGuessTest'.
# #     Error:  Can't load '/scratch/devel/p5-ExtUtils-CppGuess/work/ExtUtils-CppGuess-0.12/t/makemaker/blib/arch/auto/CppGuessTest/CppGuessTest.so' for module CppGuessTest: /scratch/devel/p5-ExtUtils-CppGuess/work/ExtUtils-CppGuess-0.12/t/makemaker/blib/arch/auto/CppGuessTest/CppGuessTest.so: Undefined symbol "_ZdlPv" (symnum = 3) at /usr/pkg/lib/perl5/5.26.0/x86_64-netbsd-thread-multi/DynaLoader.pm line 193.
# #  at t/001_load.t line 6.
# # Compilation failed in require at t/001_load.t line 6.
# # BEGIN failed--compilation aborted at t/001_load.t line 6.
# # Looks like you failed 1 test of 1.
# t/001_load.t ..
# Dubious, test returned 1 (wstat 256, 0x100)
# Failed 1/1 subtests
# Can't load '/scratch/devel/p5-ExtUtils-CppGuess/work/ExtUtils-CppGuess-0.12/t/makemaker/blib/arch/auto/CppGuessTest/CppGuessTest.so' for module CppGuessTest: /scratch/devel/p5-ExtUtils-CppGuess/work/ExtUtils-CppGuess-0.12/t/makemaker/blib/arch/auto/CppGuessTest/CppGuessTest.so: Undefined symbol "_ZdlPv" (symnum = 3) at /usr/pkg/lib/perl5/5.26.0/x86_64-netbsd-thread-multi/DynaLoader.pm line 193.
#  at t/002_base.t line 6.
# Compilation failed in require at t/002_base.t line 6.
# BEGIN failed--compilation aborted at t/002_base.t line 6.
# # Looks like your test exited with 2 before it could output anything.
# t/002_base.t ..
# Dubious, test returned 2 (wstat 512, 0x200)
# Failed 2/2 subtests
#
# Test Summary Report
# -------------------
# t/001_load.t (Wstat: 256 Tests: 1 Failed: 1)
#   Failed test:  1
#   Non-zero exit status: 1
# t/002_base.t (Wstat: 512 Tests: 0 Failed: 0)
#   Non-zero exit status: 2
#   Parse errors: Bad plan.  You planned 2 tests but ran 0.
# Files=2, Tests=1,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.08 cusr  0.04 csys =  0.16 CPU)
# Result: FAIL
# Failed 2/2 test programs. 1/1 subtests failed.
# *** Error code 2
#
# Stop.
# make[1]: stopped in /scratch/devel/p5-ExtUtils-CppGuess/work/ExtUtils-CppGuess-0.12/t/makemaker
# ========================================
# Looks like you failed 1 test of 1.
t/011_makemaker.t ..... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests

Test Summary Report
-------------------
t/011_makemaker.t   (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=3, Tests=4,  4 wallclock secs ( 0.02 usr  0.01 sys +  2.26 cusr  0.90 csys =  3.19 CPU)
Result: FAIL
Failed 1/3 test programs. 1/4 subtests failed.
*** Error code 1
mohawk2 commented 7 years ago

Thanks for the report! Could you tell me what platform you're on?

0-wiz-0 commented 7 years ago

Sure, that's on NetBSD-8.99.5/amd64.

mohawk2 commented 5 years ago

Could you try this with the new 0.13? Its tests give a lot more info. Closing till then, but please do give the test outputs if it doesn't work!

0-wiz-0 commented 5 years ago

Sure, here's the output with 0.13:

===> Testing for p5-ExtUtils-CppGuess-0.13
PERL_DL_NONLAZY=1 "/usr/pkg/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/001_load.t .......... 1/? # EUMM:{
#   'CCFLAGS' => ' -O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe -xc++',
#   'dynamic_lib' => {
#     'OTHERLDFLAGS' => ' -lstdc++ -lgcc_s'
#   }
# }
# ---
# MB:{
#   'extra_compiler_flags' => ' -O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe -xc++',
#   'extra_linker_flags' => ' -lstdc++ -lgcc_s'
# }
# ---
# Config:{
#   'byacc' => 'byacc',
#   'cc' => 'gcc',
#   'cccdlflags' => '-DPIC -fPIC ',
#   'ccdlflags' => '-Wl,-E  -Wl,-R/usr/pkg/lib/perl5/5.28.0/x86_64-netbsd-thread-multi/CORE',
#   'ccflags' => '-O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe',
#   'ccflags_nolargefiles' => '-O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe',
#   'ccflags_uselargefiles' => '',
#   'ccname' => 'gcc',
#   'ccsymbols' => '=1',
#   'ccversion' => '',
#   'ccwarnflags' => ' -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings',
#   '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' => undef,
#   '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' => undef,
#   'd_sched_yield' => 'define',
#   'd_strtold' => 'define',
#   'd_strtold_l' => 'define',
#   'd_telldir' => 'define',
#   'd_telldirproto' => 'define',
#   'gccansipedantic' => '',
#   'gccosandvers' => '',
#   'gccversion' => '7.4.0',
#   'i_sysaccess' => undef,
#   'ld' => 'gcc',
#   'ld_can_script' => 'define',
#   'lddlflags' => '-shared  -Wl,-z,relro -Wl,-z,now -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib',
#   'ldflags' => ' -Wl,-z,relro -Wl,-z,now -pthread -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib',
#   'ldflags_nolargefiles' => ' -Wl,-z,relro -Wl,-z,now -pthread -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/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_msvc = undef
# Method: is_gcc = 1
# Method: compiler_command = 'g++ -O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe -xc++'
# Method: linker_flags = '-lstdc++ -lgcc_s'
t/001_load.t .......... ok
t/002_icpp.t .......... ok
t/010_module_build.t .. ok
t/011_makemaker.t ..... 1/?
#   Failed test 'build with ExtUtils::MakeMaker'
#   at t/011_makemaker.t line 11.
# Makefile.PL output
# ========================================
# Checking if your kit is complete...
# Looks good
# Generating a Unix-style Makefile
# Writing Makefile for CppGuessTest
# Writing MYMETA.yml and MYMETA.json
# ========================================
# make output
# ========================================
# cp lib/CppGuessTest.pm blib/lib/CppGuessTest.pm
# Running Mkbootstrap for CppGuessTest ()
# chmod 644 "CppGuessTest.bs"
# "/usr/pkg/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- CppGuessTest.bs blib/arch/auto/CppGuessTest/CppGuessTest.bs 644
# "/usr/pkg/bin/perl" "/usr/pkg/lib/perl5/5.28.0/ExtUtils/xsubpp"  -typemap '/usr/pkg/lib/perl5/5.28.0/ExtUtils/typemap' -typemap '/scratch/devel/p5-ExtUtils-CppGuess/work/ExtUtils-CppGuess-0.13/t/makemaker/typemap'  CppGuessTest.xs > CppGuessTest.xsc
# mv CppGuessTest.xsc CppGuessTest.c
# gcc -c    -O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe -xc++ -O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -I/usr/include  -g   -I/usr/include    -DVERSION=\"0.01\"  -DXS_VERSION=\"0.01\" -DPIC -fPIC "-I/usr/pkg/lib/perl5/5.28.0/x86_64-netbsd-thread-multi/CORE"   CppGuessTest.c
# rm -f blib/arch/auto/CppGuessTest/CppGuessTest.so
# gcc  -shared  -Wl,-z,relro -Wl,-z,now -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib  CppGuessTest.o -Wl,-z,relro -Wl,-z,now  -L/usr/pkg/lib -Wl,-R/usr/pkg/lib/perl5/5.28.0/x86_64-netbsd-thread-multi/CORE -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -o blib/arch/auto/CppGuessTest/CppGuessTest.so     "-L/usr/pkg/lib/perl5/5.28.0/x86_64-netbsd-thread-multi/CORE" "-Wl,-R/usr/pkg/lib/perl5/5.28.0/x86_64-netbsd-thread-multi/CORE" "-Wl,-R/usr/pkg/lib/perl5/5.28.0/x86_64-netbsd-thread-multi/CORE" -lperl
# chmod 755 blib/arch/auto/CppGuessTest/CppGuessTest.so
# ========================================
# make test output
# ========================================
# "/usr/pkg/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- CppGuessTest.bs blib/arch/auto/CppGuessTest/CppGuessTest.bs 644
# PERL_DL_NONLAZY=1 "/usr/pkg/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
#
# #   Failed test 'use CppGuessTest;'
# #   at t/001_load.t line 4.
# #     Tried to use 'CppGuessTest'.
# #     Error:  Can't load '/scratch/devel/p5-ExtUtils-CppGuess/work/ExtUtils-CppGuess-0.13/t/makemaker/blib/arch/auto/CppGuessTest/CppGuessTest.so' for module CppGuessTest: /scratch/devel/p5-ExtUtils-CppGuess/work/ExtUtils-CppGuess-0.13/t/makemaker/blib/arch/auto/CppGuessTest/CppGuessTest.so: Undefined PLT symbol "_ZdlPv" (symnum = 3) at /usr/pkg/lib/perl5/5.28.0/x86_64-netbsd-thread-multi/DynaLoader.pm line 193.
# #  at t/001_load.t line 4.
# # Compilation failed in require at t/001_load.t line 4.
# # BEGIN failed--compilation aborted at t/001_load.t line 4.
# # Looks like you failed 1 test of 1.
# t/001_load.t ..
# Dubious, test returned 1 (wstat 256, 0x100)
# Failed 1/1 subtests
# Can't load '/scratch/devel/p5-ExtUtils-CppGuess/work/ExtUtils-CppGuess-0.13/t/makemaker/blib/arch/auto/CppGuessTest/CppGuessTest.so' for module CppGuessTest: /scratch/devel/p5-ExtUtils-CppGuess/work/ExtUtils-CppGuess-0.13/t/makemaker/blib/arch/auto/CppGuessTest/CppGuessTest.so: Undefined PLT symbol "_ZdlPv" (symnum = 3) at /usr/pkg/lib/perl5/5.28.0/x86_64-netbsd-thread-multi/DynaLoader.pm line 193.
#  at t/002_base.t line 4.
# Compilation failed in require at t/002_base.t line 4.
# BEGIN failed--compilation aborted at t/002_base.t line 4.
# # Looks like your test exited with 2 before it could output anything.
# t/002_base.t ..
# Dubious, test returned 2 (wstat 512, 0x200)
# Failed 2/2 subtests
#
# Test Summary Report
# -------------------
# t/001_load.t (Wstat: 256 Tests: 1 Failed: 1)
#   Failed test:  1
#   Non-zero exit status: 1
# t/002_base.t (Wstat: 512 Tests: 0 Failed: 0)
#   Non-zero exit status: 2
#   Parse errors: Bad plan.  You planned 2 tests but ran 0.
# Files=2, Tests=1,  1 wallclock secs ( 0.03 usr  0.03 sys +  0.21 cusr  0.19 csys =  0.46 CPU)
# Result: FAIL
# Failed 2/2 test programs. 1/1 subtests failed.
# *** Error code 2
#
# Stop.
# make[1]: stopped in /scratch/devel/p5-ExtUtils-CppGuess/work/ExtUtils-CppGuess-0.13/t/makemaker
# ========================================
# Looks like you failed 1 test of 1.
t/011_makemaker.t ..... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests

Test Summary Report
-------------------
t/011_makemaker.t   (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=4, Tests=11, 11 wallclock secs ( 0.02 usr  0.06 sys +  4.24 cusr  4.55 csys =  8.87 CPU)
Result: FAIL
Failed 1/4 test programs. 1/11 subtests failed.
*** Error code 1
mohawk2 commented 5 years ago

So it's failing only on EUMM. Could you look in t/makemaker/Makefile, and show the contents of the # MakeMaker Parameters section near the top?

mohawk2 commented 5 years ago

Also, what version of EUMM have you installed? Also, could you show output of perl -V?

0-wiz-0 commented 5 years ago

Here are the parameters:

#   MakeMaker Parameters:

#     BUILD_REQUIRES => {  }
#     CCFLAGS => q[ -O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe -xc++]
#     CONFIGURE_REQUIRES => {  }
#     NAME => q[CppGuessTest]
#     PL_FILES => {  }
#     PREREQ_PM => {  }
#     TEST_REQUIRES => {  }
#     VERSION_FROM => q[lib/CppGuessTest.pm]
#     dynamic_lib => { OTHERLDFLAGS=>q[ -lstdc++ -lgcc_s] }

I don't know what EUMM is, I have the following dependencies installed:

inc-latest 0.500
Module-Build 0.42240
Capture-Tiny 0.48

perl -V says:

Summary of my perl5 (revision 5 version 28 subversion 1) configuration:

  Platform:
    osname=netbsd
    osvers=8.99.36
    archname=x86_64-netbsd-thread-multi
    uname='netbsd yt.nih.at 8.99.36 netbsd 8.99.36 (kvothe) #65: wed mar 20 23:43:41 cet 2019 wiz@yt.nih.at:disk6archiveforeignsrcsysarchamd64compileobjkvothe amd64 '
    config_args='-sde -Dldflags= -Wl,-z,relro -Wl,-z,now  -pthread  -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -Duseshrplib -Duseithreads -Uusemymalloc' 
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='gcc'
    ccflags ='-O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe'
    optimize='-O2 -g -D_FORTIFY_SOURCE=2 -fstack-check  -pthread  -I/usr/include'
    cppflags='-O2 -g -D_FORTIFY_SOURCE=2 -fstack-check -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe'
    ccversion=''
    gccversion='7.4.0'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='gcc'
    ldflags =' -Wl,-z,relro -Wl,-z,now -pthread -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib'
    libpth=/lib /usr/lib /usr/pkg/lib
    libs=-lm -lcrypt -lpthread
    perllibs=-lm -lcrypt -lpthread
    libc=/lib/libc.so
    so=so
    useshrplib=true
    libperl=libperl.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E  -Wl,-R/usr/pkg/lib/perl5/5.28.0/x86_64-netbsd-thread-multi/CORE'
    cccdlflags='-DPIC -fPIC '
    lddlflags='-shared  -Wl,-z,relro -Wl,-z,now -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib'

Characteristics of this binary (from libperl):
  Compile-time options:
    HAS_TIMES
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_IMPLICIT_CONTEXT
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_ITHREADS
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
    USE_REENTRANT_API
  Built under netbsd
  Compiled at Mar 21 2019 07:14:08
  %ENV:
  @INC:
    /usr/pkg/lib/perl5/site_perl/5.28.0/x86_64-netbsd-thread-multi
    /usr/pkg/lib/perl5/site_perl/5.28.0
    /usr/pkg/lib/perl5/vendor_perl/5.28.0/x86_64-netbsd-thread-multi
    /usr/pkg/lib/perl5/vendor_perl/5.28.0
    /usr/pkg/lib/perl5/5.28.0/x86_64-netbsd-thread-multi
    /usr/pkg/lib/perl5/5.28.0

(redacted)

mohawk2 commented 5 years ago

EUMM = ExtUtils::MakeMaker. You can see which version you have with the V module (cpanm V if you don't):

perl -MV=ExtUtils::MakeMaker

mohawk2 commented 5 years ago

Also, I asked two questions and I still need an answer to:

Could you look in t/makemaker/Makefile, and show the contents of the # MakeMaker Parameters section near the top?

Reason is your MB build works, so EUCppG is getting the right info, but EUMM for some reason isn't adding the linker flags to the actual link command, and I expect that's why it's not working. Let's find out!

0-wiz-0 commented 5 years ago

The parameters are in my previous reply, right after "Here are the parameters:".

I tried:

# perl -MExtUtils::MakeMaker -le 'print $ExtUtils::MakeMaker::VERSION'  
7.34

I hope that's what you wanted to see?

mohawk2 commented 5 years ago

The parameters are in my previous reply, right after "Here are the parameters:".

So you did! Poor comprehension on my part.

And 7.34 was what I'd expect for 5.28.1. Could you please look in t/makemaker/Makefile for the dynamic_lib section? For comparison, here is mine:

# --- MakeMaker dynamic_lib section:
# This section creates the dynamically loadable objects from relevant
# objects and possibly $(MYEXTLIB).
ARMAYBE = :
OTHERLDFLAGS =  -lstdc++
INST_DYNAMIC_DEP = 
INST_DYNAMIC_FIX = 

$(INST_DYNAMIC) : $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP) 
        $(RM_F) $@
        $(LD)  $(LDDLFLAGS)  $(LDFROM) $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) \
          $(PERL_ARCHIVE) $(LDLOADLIBS) $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST) \
          $(INST_DYNAMIC_FIX)
        $(CHMOD) $(PERM_RWX) $@
mohawk2 commented 5 years ago

By the way, I note your kernel seems to be recently built. Are you using a NetBSD perl "port"? If so, could you see if there are any changes it makes to dynamic linking? The make output for the linking line looks like it has the flags I would expect replaced by what looks bespoke.

0-wiz-0 commented 5 years ago

The section you asked for looks like this:

# --- MakeMaker dynamic_lib section:
# This section creates the dynamically loadable objects from relevant
# objects and possibly $(MYEXTLIB).
ARMAYBE = :
OTHERLDFLAGS =  -lstdc++ -lgcc_s
INST_DYNAMIC_DEP = 
INST_DYNAMIC_FIX = 

$(INST_DYNAMIC) : $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP) 
        $(RM_F) $@
        $(LD)  $(LDDLFLAGS)  $(LDFROM) $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) \
          $(PERL_ARCHIVE) $(LDLOADLIBS) "-L$(PERL_INC)" "-Wl,-R$(INSTALLARCHLIB)/CORE" "-Wl,-R$(PERL_ARCHLIB)/CORE" -lperl $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST) \
          $(INST_DYNAMIC_FIX)
        $(CHMOD) $(PERM_RWX) $@

I am indeed using the perl package from pkgsrc. The patches that pkgsrc applies on top of the distribution file are visible here: https://github.com/NetBSD/pkgsrc/tree/trunk/lang/perl5/patches I hope you find what you're looking for there!

mohawk2 commented 5 years ago

It looks like your EUMM is inserting text between $(LDLOADLIBS) and $(PERL_ARCHIVE_AFTER).

Is there any way I could login to your machine to see what's going on? If not, could you at least edit t/makemaker/Makefile to have that recipe read (please make sure the leading whitespace is tab characters):

$(INST_DYNAMIC) : $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP) 
        $(RM_F) $@
        echo OTHERLDFLAGS is $(OTHERLDFLAGS)
        $(LD)  $(LDDLFLAGS)  $(LDFROM) $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) \
          $(PERL_ARCHIVE) $(LDLOADLIBS) "-L$(PERL_INC)" "-Wl,-R$(INSTALLARCHLIB)/CORE" "-Wl,-R$(PERL_ARCHLIB)/CORE" -lperl $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST) \
          $(INST_DYNAMIC_FIX)
        $(CHMOD) $(PERM_RWX) $@

then exercise it with:

cd t/makemaker # if not there already
rm blib/arch/auto/CppGuessTest/CppGuessTest.so
make

and tell me output?

0-wiz-0 commented 5 years ago

Ok, quite possibly this might be a symptom of the build infrastructure I use. The pkgsrc framework (in which I ran the tests) has a compiler wrapper that modifies the arguments. When I run the test outside the framework, it succeeds. I think I'll close this now, sorry for wasting your time :(

mohawk2 commented 5 years ago

Glad to, let's say, help! :-)