Bug 2341021 - perl-CommonMark-0.310100-2.fc42 FTBFS: CommonMark.c:675:18: error: too many arguments to function ‘XSFUNCTION’; expected 0, have 1
Summary: perl-CommonMark-0.310100-2.fc42 FTBFS: CommonMark.c:675:18: error: too many a...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-CommonMark
Version: 42
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Emmanuel Seyman
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F42FTBFS
TreeView+ depends on / blocked
 
Reported: 2025-01-22 21:18 UTC by Fedora Release Engineering
Modified: 2025-08-31 08:51 UTC (History)
2 users (show)

Fixed In Version: perl-CommonMark-0.310100-3.fc43
Clone Of:
Environment:
Last Closed: 2025-08-31 08:51:15 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
build.log (16.63 KB, text/plain)
2025-01-22 21:18 UTC, Fedora Release Engineering
no flags Details
root.log (32.00 KB, text/plain)
2025-01-22 21:18 UTC, Fedora Release Engineering
no flags Details
state.log (1.69 KB, text/plain)
2025-01-22 21:18 UTC, Fedora Release Engineering
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github Perl perl5 issues 23192 0 None open The CommonMark module cannot be built using gcc 15 and perl 5.40.1 2025-04-13 19:03:21 UTC

Description Fedora Release Engineering 2025-01-22 21:18:04 UTC
perl-CommonMark failed to build from source in Fedora rawhide/f42

https://koji.fedoraproject.org/koji/taskinfo?taskID=128031648


For details on the mass rebuild see:

https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
Please fix perl-CommonMark at your earliest convenience and set the bug's status to
ASSIGNED when you start fixing it. If the bug remains in NEW state for 8 weeks,
perl-CommonMark will be orphaned. Before branching of Fedora 43,
perl-CommonMark will be retired, if it still fails to build.

For more details on the FTBFS policy, please visit:
https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/

Comment 1 Fedora Release Engineering 2025-01-22 21:18:07 UTC
Created attachment 2071594 [details]
build.log

Comment 2 Fedora Release Engineering 2025-01-22 21:18:08 UTC
Created attachment 2071595 [details]
root.log

file root.log too big, will only attach last 32768 bytes

Comment 3 Fedora Release Engineering 2025-01-22 21:18:09 UTC
Created attachment 2071596 [details]
state.log

Comment 4 Aoife Moloney 2025-02-26 13:41:45 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 5 Petr Pisar 2025-03-24 09:41:12 UTC
From build.log:

gcc -c   -D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -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 -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer   -DVERSION=\"0.310100\" -DXS_VERSION=\"0.310100\" -fPIC "-I/usr/lib64/perl5/CORE"   CommonMark.c
CommonMark.c: In function ‘XS_CommonMark__Node_interface_get_node’:
CommonMark.c:675:18: error: too many arguments to function ‘XSFUNCTION’; expected 0, have 1
  675 |         RETVAL = XSFUNCTION(node);
      |                  ^~~~~~~~~~ ~~~~
CommonMark.c: In function ‘XS_CommonMark__Node_interface_get_int’:
CommonMark.c:701:18: error: too many arguments to function ‘XSFUNCTION’; expected 0, have 1
  701 |         RETVAL = XSFUNCTION(node);
      |                  ^~~~~~~~~~ ~~~~
[...]

A difference between passing and failing build root is at <https://koschei.fedoraproject.org/build/19465911>. This failure is triggered by upgrading gcc from version 14 to 15.

Comment 6 Petr Pisar 2025-06-12 09:07:13 UTC
The offending generated C code from XS file with Extutils::ParseXS:

XS_EUPXS(XS_CommonMark__Node_interface_get_node); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_CommonMark__Node_interface_get_node)
{
    dVAR; dXSARGS;
    dXSFUNCTION(cmark_node *);
    if (items != 1)
       croak_xs_usage(cv,  "node");
    {
    cmark_node *    RETVAL;
    cmark_node *    node = (cmark_node*)S_sv2c(aTHX_ ST(0), "CommonMark::Node", 16, cv,
                               "node")
;
    XSFUNCTION = XSINTERFACE_FUNC(cmark_node *,cv,XSANY.any_dptr);

→   RETVAL = XSFUNCTION(node);
    {
        SV * RETVALSV;
    RETVALSV = S_node2sv(aTHX_ RETVAL);
        RETVALSV = sv_2mortal(RETVALSV);
        ST(0) = RETVALSV;
    }
    }
    XSRETURN(1);
}


XSFUNCTION is declared with dXSFUNCTION() macro defined in XSUB.h as:

#ifdef __cplusplus
#  define XSINTERFACE_CVT(ret,name) ret (*name)(...)
#  define XSINTERFACE_CVT_ANON(ret) ret (*)(...)
#else
#  define XSINTERFACE_CVT(ret,name) ret (*name)()
#  define XSINTERFACE_CVT_ANON(ret) ret (*)()
#endif
#define dXSFUNCTION(ret)                XSINTERFACE_CVT(ret,XSFUNCTION)
#define XSINTERFACE_FUNC(ret,cv,f)     ((XSINTERFACE_CVT_ANON(ret))(f))
#define XSINTERFACE_FUNC_SET(cv,f)      \
                CvXSUBANY(cv).any_dxptr = (void (*) (pTHX_ void*))(f)

It seems that ExtUtils::ParseXS does not conform to C23 and declares the function pointer as a pointer to a function with an empty argument list ("ret (*)()").

Comment 7 Petr Pisar 2025-06-12 10:35:58 UTC
It is a bug in ExtUtils::ParseXS <https://github.com/Perl/perl5/issues/23192>. Until it is fixed, I recommend adding -std=c99 to CCFLAGS in Makefile.PL.

Comment 8 Emmanuel Seyman 2025-08-31 08:51:15 UTC
Fixed by Adam Williamson a while back:
https://koji.fedoraproject.org/koji/buildinfo?buildID=2744003


Note You need to log in before you can comment on or make changes to this bug.