Menu

#265 Build fails with implicit-int in a configure test probe

Performance problem
open
nobody
None
5
2024-05-15
2024-03-15
No

GCC 14 and clang 16 make some things that were illegal starting c99, into fatal errors by default.

For GCC 13 (and earlier) you can test this out by manually setting -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types

Some additional details can be found at https://wiki.gentoo.org/wiki/Modern_C_porting#FAQ

When building xsb, in config.log, the following conftest fails using Modern C settings:

configure:6888: checking whether loader understands -Wl,-export-dynamic
configure:6896: x86_64-pc-linux-gnu-gcc -o conftest -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -Wno-error=format-security -fno-strict-aliasing  -Wl,-export-dynamic conftest.c  -lpthread -lnsl -ldl -lm  >&5
conftest.c:78:1: error: return type defaults to 'int' [-Werror=implicit-int]
   78 | main(){return 0;}
      | ^~~~
cc1: some warnings being treated as errors
configure:6896: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""

[...]

| /* end confdefs.h.  */
| main(){return 0;}
configure:6904: result: no

Happens due to configure.in which contains this invalid C code:

AC_LINK_IFELSE([AC_LANG_SOURCE([[main(){return 0;}]])], __export_dynamic=yes, __export_dynamic=no)

Result: running make eventually fails due to:

-------------- Warnings/Errors --------------------
While compiling XSB/packages:

++Error[XSB]: [Runtime/C] /var/tmp/portage/dev-lang/xsb-4.0.0/work/XSB/packages/regmatch/cc/xsb_re_match.so: undefined symbol: VarStrOps
++Error[XSB/Runtime/P]: [Miscellaneous] Error in loading file /var/tmp/portage/dev-lang/xsb-4.0.0/work/XSB/packages/regmatch/cc/xsb_re_match.xwam.localhost-633

Previously reported at https://bugs.gentoo.org/870970

Discussion

  • Michael Kifer

    Michael Kifer - 2024-03-15
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style id="bidiui-paragraph-margins" type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>

    I hope I fixed this by changing to

    int main(){return 0;}
    
    
    On 3/14/24 8:23 PM, Eli Schwartz wrote:
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

    [bugs:#265] Build fails with implicit-int in a configure test probe

    Status: open
    Group: Performance problem
    Created: Fri Mar 15, 2024 12:23 AM UTC by Eli Schwartz
    Last Updated: Fri Mar 15, 2024 12:23 AM UTC
    Owner: nobody

    GCC 14 and clang 16 make some things that were illegal starting c99, into fatal errors by default.

    For GCC 13 (and earlier) you can test this out by manually setting -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types

    Some additional details can be found at https://wiki.gentoo.org/wiki/Modern_C_porting#FAQ

    When building xsb, in config.log, the following conftest fails using Modern C settings:

    configure:6888: checking whether loader understands -Wl,-export-dynamic
    configure:6896: x86_64-pc-linux-gnu-gcc -o conftest -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -Wno-error=format-security -fno-strict-aliasing  -Wl,-export-dynamic conftest.c  -lpthread -lnsl -ldl -lm  >&5
    conftest.c:78:1: error: return type defaults to 'int' [-Werror=implicit-int]
       78 | main(){return 0;}
          | ^~~~
    cc1: some warnings being treated as errors
    configure:6896: $? = 1
    configure: failed program was:
    | /* confdefs.h */
    | #define PACKAGE_NAME ""
    
    [...]
    
    | /* end confdefs.h.  */
    | main(){return 0;}
    configure:6904: result: no
    

    Happens due to configure.in which contains this invalid C code:

    AC_LINK_IFELSE([AC_LANG_SOURCE([[main(){return 0;}]])], __export_dynamic=yes, __export_dynamic=no)
    

    Result: running make eventually fails due to:

    -------------- Warnings/Errors --------------------
    While compiling XSB/packages:
    
    ++Error[XSB]: [Runtime/C] /var/tmp/portage/dev-lang/xsb-4.0.0/work/XSB/packages/regmatch/cc/xsb_re_match.so: undefined symbol: VarStrOps
    ++Error[XSB/Runtime/P]: [Miscellaneous] Error in loading file /var/tmp/portage/dev-lang/xsb-4.0.0/work/XSB/packages/regmatch/cc/xsb_re_match.xwam.localhost-633
    

    Previously reported at https://bugs.gentoo.org/870970


    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/xsb/bugs/265/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

    <link itemprop="url" href="https://sourceforge.net/p/xsb/bugs/265/"> <meta itemprop="name" content="View">
    <meta itemprop="description" content="View">
     
    • Eli Schwartz

      Eli Schwartz - 2024-05-15

      It should, yes, that's the local fix I made too.

       
      • Michael Kifer

        Michael Kifer - 2024-05-15
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style id="bidiui-paragraph-margins" type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>

        are you sure you are using the latest from the git repository? This bug was fixed exactly 2 months ago


        On 5/14/24 11:23 PM, Eli Schwartz wrote:
        It should, yes, that's the local fix I made too.
        
        
        ---
        
        **[bugs:#265] Build fails with implicit-int in a configure test probe**
        
        **Status:** open
        **Group:** Performance problem
        **Created:** Fri Mar 15, 2024 12:23 AM UTC by Eli Schwartz
        **Last Updated:** Fri Mar 15, 2024 12:23 AM UTC
        **Owner:** nobody
        
        
        GCC 14 and clang 16 make some things that were illegal starting c99, into fatal errors by default.
        
        For GCC 13 (and earlier) you can test this out by manually setting `-Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types`
        
        Some additional details can be found at https://wiki.gentoo.org/wiki/Modern_C_porting#FAQ
        
        When building xsb, in config.log, the following conftest fails using Modern C settings:
        
        
        
        configure:6888: checking whether loader understands -Wl,-export-dynamic
        configure:6896: x86_64-pc-linux-gnu-gcc -o conftest -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -Wno-error=format-security -fno-strict-aliasing  -Wl,-export-dynamic conftest.c  -lpthread -lnsl -ldl -lm  &gt;&amp;5
        conftest.c:78:1: error: return type defaults to 'int' [-Werror=implicit-int]
           78 | main(){return 0;}
              | ^~~~
        cc1: some warnings being treated as errors
        configure:6896: $? = 1
        configure: failed program was:
        | /* confdefs.h */
        | #define PACKAGE_NAME ""
        
        [...]
        
        | /* end confdefs.h.  */
        | main(){return 0;}
        configure:6904: result: no
        
        Happens due to configure.in which contains this invalid C code:
        AC_LINK_IFELSE([AC_LANG_SOURCE([[main(){return 0;}]])], __export_dynamic=yes, __export_dynamic=no)
        
        Result: running make eventually fails due to:
        -------------- Warnings/Errors --------------------
        While compiling XSB/packages:
        
        ++Error[XSB]: [Runtime/C] /var/tmp/portage/dev-lang/xsb-4.0.0/work/XSB/packages/regmatch/cc/xsb_re_match.so: undefined symbol: VarStrOps
        ++Error[XSB/Runtime/P]: [Miscellaneous] Error in loading file /var/tmp/portage/dev-lang/xsb-4.0.0/work/XSB/packages/regmatch/cc/xsb_re_match.xwam.localhost-633
        
        Previously reported at https://bugs.gentoo.org/870970 --- Sent from sourceforge.net because you indicated interest in <https://sourceforge.net/p/xsb/bugs/265/> To unsubscribe from further messages, please visit <https://sourceforge.net/auth/subscriptions/>
         

Log in to post a comment.