Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface.so: undefined symbol: sv_nv #303

Open
jplesnik opened this issue May 30, 2023 · 2 comments
Open

Interface.so: undefined symbol: sv_nv #303

jplesnik opened this issue May 30, 2023 · 2 comments

Comments

@jplesnik
Copy link

The tests are failing because the deprecated C functions were removed in Perl 5.37.1.
More information could be found on perl5371delta.pod#Deprecations

#   Failed test 'use SDLx::App;'
#   at t/00-load.t line 88.
#     Tried to use 'SDLx::App'.
#     Error:  Can't load '/home/cpansand/.cpan/build/2022100913/SDL-2.548-0/blib/arch/auto/SDLx/Controller/Interface/Interface.so' for module SDLx::Controller::Interface: /home/cpansand/.cpan/build/2022100913/SDL-2.548-0/blib/arch/auto/SDLx/Controller/Interface/Interface.so: undefined symbol: sv_nv at /opt/perl-5.37.4/lib/5.37.4/x86_64-linux/DynaLoader.pm line 206.
#  at /home/cpansand/.cpan/build/2022100913/SDL-2.548-0/blib/lib/SDLx/Controller.pm line 10.
# Compilation failed in require at /home/cpansand/.cpan/build/2022100913/SDL-2.548-0/blib/lib/SDLx/Controller.pm line 10.
# BEGIN failed--compilation aborted at /home/cpansand/.cpan/build/2022100913/SDL-2.548-0/blib/lib/SDLx/Controller.pm line 10.
# Compilation failed in require at /opt/perl-5.37.4/lib/5.37.4/base.pm line 137.
# 	...propagated at /opt/perl-5.37.4/lib/5.37.4/base.pm line 159.
# BEGIN failed--compilation aborted at /home/cpansand/.cpan/build/2022100913/SDL-2.548-0/blib/lib/SDLx/App.pm line 23.
# Compilation failed in require at t/00-load.t line 88.
# BEGIN failed--compilation aborted at t/00-load.t line 88.
Bailout called.  Further testing stopped:  Test failed.  BAIL OUT!.
t/00-load.t ..................... 
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/43 subtests 
@jplesnik
Copy link
Author

The definition of sv_nv in mathoms.c (Perl 5.36) is:

=for apidoc_section $SV
=for apidoc sv_nv

A private implementation of the C<SvNVx> macro for compilers which can't
cope with complex macro expressions.  Always use the macro instead.

=cut
*/

NV
Perl_sv_nv(pTHX_ SV *sv)
{
    PERL_ARGS_ASSERT_SV_NV;

    if (SvNOK(sv))
        return SvNVX(sv);
    return sv_2nv(sv);
}  

I tried to use SvNVX instead of sv_nv and it worked for me.

@ppisar
Copy link

ppisar commented Jul 12, 2023

Indeed. Perl removed sv_nv macro from embed.h in:

commit 7008caa915ad99e650acf2aea40612b5e48b7ba2
Author: Karl Williamson <[email protected]>
Date:   Sat May 28 15:30:19 2022 -0600

    Remove deprecated functions
    
    Most of these have been deprecated for a long time; and we've never
    bothered to follow through in removing them.  This commit does that.

Which happened between Perl v5.37.0 and v5.37.1.

ppisar added a commit to ppisar/SDL that referenced this issue Jul 12, 2023
Perl 5.37.1 removed a deprecated sv_nv() macro and SDL fails to build
with Perl 5.38.0:

lib/SDLx/Controller/Interface.xs:60:26: error: implicit declaration of function 'sv_nv'
   60 |         out->dv_x      = sv_nv(temp);
      |                          ^~~~~

Users are advised to use SvNVx() macro instead. SvNVx() seems to have been
available all the time (it predates a commit from 1993-10-07).

This patch does that.

PerlGameDev#303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants