Thread

Commits

  1. Update configure probes for CFLAGS needed for ARM CRC instructions.

  1. BUG #18839: ARMv7 builds fail due to missing __crc32cw and similar

    The Post Office <noreply@postgresql.org> — 2025-03-12T05:40:28Z

    The following bug has been logged on the website:
    
    Bug reference:      18839
    Logged by:          Mathew
    Email address:      mat999@gmail.com
    PostgreSQL version: 14.17
    Operating system:   Debian
    Description:        
    
    Changes made to support hardware CRC seem to have broken ARMv7 builds for
    us.
    
    When building we are now getting:
    
    ```
    pg_crc32c_armv8.c:(.text+0x40): undefined reference to `__crc32cw'
    /usr/bin/ld: pg_crc32c_armv8.c:(.text+0x6c): undefined reference to
    `__crc32cw'
    /usr/bin/ld: pg_crc32c_armv8.c:(.text+0x7a): undefined reference to
    `__crc32ch'
    /usr/bin/ld: pg_crc32c_armv8.c:(.text+0x92): undefined reference to
    `__crc32cd'
    /usr/bin/ld: pg_crc32c_armv8.c:(.text+0x8a): undefined reference to
    `__crc32cb'
    collect2: error: ld returned 1 exit status
    make[2]: *** [Makefile:66: postgres] Error 1
    make[1]: *** [Makefile:42: all-backend-recurse] Error 2
    make: *** [GNUmakefile:11: all-src-recurse] Error 2", "stderr_lines":
    ["pg_crc32c_armv8.c: In function ‘pg_comp_crc32c_armv8’:",
    "pg_crc32c_armv8.c:35:23: warning: implicit declaration of function
    ‘__crc32cb’ [-Wimplicit-function-declaration]", "   35 |                 crc
    = __crc32cb(crc, *p);", "      |                       ^~~~~~~~~",
    "pg_crc32c_armv8.c:41:23: warning: implicit declaration of function
    ‘__crc32ch’ [-Wimplicit-function-declaration]", "   41 |                 crc
    = __crc32ch(crc, *(uint16 *) p);", "      |                      
    ^~~~~~~~~", "pg_crc32c_armv8.c:47:23: warning: implicit declaration of
    function ‘__crc32cw’ [-Wimplicit-function-declaration]", "   47 |           
         crc = __crc32cw(crc, *(uint32 *) p);", "      |                      
    ^~~~~~~~~", "pg_crc32c_armv8.c:54:23: warning: implicit declaration of
    function ‘__crc32cd’ [-Wimplicit-function-declaration]", "   54 |           
         crc = __crc32cd(crc, *(uint64 *) p);", "      |                      
    ^~~~~~~~~", "pg_crc32c_armv8.c: In function ‘pg_comp_crc32c_armv8’:",
    "pg_crc32c_armv8.c:35:23: warning: implicit declaration of function
    ‘__crc32cb’ [-Wimplicit-function-declaration]", "   35 |                 crc
    = __crc32cb(crc, *p);", "      |                       ^~~~~~~~~",
    "pg_crc32c_armv8.c:41:23: warning: implicit declaration of function
    ‘__crc32ch’ [-Wimplicit-function-declaration]", "   41 |                 crc
    = __crc32ch(crc, *(uint16 *) p);", "      |                      
    ^~~~~~~~~", "pg_crc32c_armv8.c:47:23: warning: implicit declaration of
    function ‘__crc32cw’ [-Wimplicit-function-declaration]", "   47 |           
         crc = __crc32cw(crc, *(uint32 *) p);", "      |                      
    ^~~~~~~~~", "pg_crc32c_armv8.c:54:23: warning: implicit declaration of
    function ‘__crc32cd’ [-Wimplicit-function-declaration]", "   54 |           
         crc = __crc32cd(crc, *(uint64 *) p);", "      |                      
    ^~~~~~~~~", "pg_crc32c_armv8.c: In function ‘pg_comp_crc32c_armv8’:",
    "pg_crc32c_armv8.c:35:23: warning: implicit declaration of function
    ‘__crc32cb’ [-Wimplicit-function-declaration]", "   35 |                 crc
    = __crc32cb(crc, *p);", "      |                       ^~~~~~~~~",
    "pg_crc32c_armv8.c:41:23: warning: implicit declaration of function
    ‘__crc32ch’ [-Wimplicit-function-declaration]", "   41 |                 crc
    = __crc32ch(crc, *(uint16 *) p);", "      |                      
    ^~~~~~~~~", "pg_crc32c_armv8.c:47:23: warning: implicit declaration of
    function ‘__crc32cw’ [-Wimplicit-function-declaration]", "   47 |           
         crc = __crc32cw(crc, *(uint32 *) p);", "      |                      
    ^~~~~~~~~", "pg_crc32c_armv8.c:54:23: warning: implicit declaration of
    function ‘__crc32cd’ [-Wimplicit-function-declaration]", "   54 |           
         crc = __crc32cd(crc, *(uint64 *) p);", "      |                      
    ^~~~~~~~~", "/usr/bin/ld:
    ../../src/port/libpgport_srv.a(pg_crc32c_armv8_srv.o): in function
    `pg_comp_crc32c_armv8':", "pg_crc32c_armv8.c:(.text+0x16): undefined
    reference to `__crc32cb'", "/usr/bin/ld: pg_crc32c_armv8.c:(.text+0x2a):
    undefined reference to `__crc32ch'", "/usr/bin/ld:
    pg_crc32c_armv8.c:(.text+0x40): undefined reference to `__crc32cw'",
    "/usr/bin/ld: pg_crc32c_armv8.c:(.text+0x6c): undefined reference to
    `__crc32cw'", "/usr/bin/ld: pg_crc32c_armv8.c:(.text+0x7a): undefined
    reference to `__crc32ch'", "/usr/bin/ld: pg_crc32c_armv8.c:(.text+0x92):
    undefined reference to `__crc32cd'", "/usr/bin/ld:
    pg_crc32c_armv8.c:(.text+0x8a): undefined reference to `__crc32cb'",
    "collect2: error: ld returned 1 exit status"
    ```
    
    It seems like the configure test is passing when it shouldnt. This CPU does
    not support hardware CRC32.
    
    
  2. Re: BUG #18839: ARMv7 builds fail due to missing __crc32cw and similar

    Tom Lane <tgl@sss.pgh.pa.us> — 2025-03-12T14:06:41Z

    PG Bug reporting form <noreply@postgresql.org> writes:
    > Changes made to support hardware CRC seem to have broken ARMv7 builds for
    > us.
    
    What is your build platform *exactly* -- what OS version, C compiler
    version, etc?  "Debian" is not an adequate description.  Did you
    use any nondefault configure options?  Which PG version did you
    last build successfully?
    
    			regards, tom lane
    
    
    
    
  3. Re: BUG #18839: ARMv7 builds fail due to missing __crc32cw and similar

    Nathan Bossart <nathandbossart@gmail.com> — 2025-03-12T21:05:05Z

    On Wed, Mar 12, 2025 at 10:06:41AM -0400, Tom Lane wrote:
    > PG Bug reporting form <noreply@postgresql.org> writes:
    >> Changes made to support hardware CRC seem to have broken ARMv7 builds for
    >> us.
    > 
    > What is your build platform *exactly* -- what OS version, C compiler
    > version, etc?  "Debian" is not an adequate description.  Did you
    > use any nondefault configure options?  Which PG version did you
    > last build successfully?
    
    The relevant parts of config.log would also be helpful.  The only recent
    change I see on REL_14_STABLE is commit 2fc0199.
    
    -- 
    nathan