Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 935401

Summary: dev-python/psycopg-3.1.19 compile fail [-Werror=strict-aliasing]
Product: Gentoo Linux Reporter: Arniii <lg3dx6fd>
Component: Current packagesAssignee: Python Gentoo Team <python>
Status: RESOLVED FIXED    
Severity: normal CC: eschwartz, lg3dx6fd
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/psycopg/psycopg/issues/867
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 618550    
Attachments: build.log
environment // profile default/linux/amd64/23.0/split-usr/desktop/plasma gcc-13.2.1_p20240210 O3 pipe march=native(verbose) lto graphite ggdb3
/etc/portage/make.conf // profile default/linux/amd64/23.0/split-usr/desktop/plasma gcc-13 O3 pipe march=native(verbose) lto graphite ggdb3 testing FEATUREs : testing

Description Arniii 2024-07-03 11:13:45 UTC
Created attachment 896848 [details]
build.log

from build.log:
```
2024-07-03 11:05:37,469 root INFO x86_64-pc-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -O3 -pipe -march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=30720 -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -fgraphite-identity -floop-interchange -floop-strip-mine -floop-nest-optimize -ggdb3 -DNDEBUG -fPIC -I/usr/include/postgresql-16 -I/usr/include/python3.10 -c psycopg_c/_psycopg.c -o /var/tmp/portage/dev-python/psycopg-3.1.19/work/psycopg-3.1.19-python3_10/build/temp.linux-x86_64-cpython-310/psycopg_c/_psycopg.o
psycopg_c/_psycopg.c: In function ‘__pyx_f_9psycopg_c_8_psycopg__array_load_binary’:
psycopg_c/_psycopg.c:34509:16: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
34509 | __pyx_v_dimptr = (__pyx_v_buf + (3 * (sizeof(uint32_t))));
      |                ^
In file included from /usr/include/sys/types.h:176,
                 from /usr/include/stdlib.h:514,
                 from /usr/include/python3.10/Python.h:34,
                 from psycopg_c/_psycopg.c:42:
psycopg_c/_psycopg.c: In function ‘__pyx_f_9psycopg_c_8_psycopg_20IntervalBinaryLoader_cload’:
psycopg_c/_psycopg.c:49642:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
49642 | __pyx_v_val = be64toh((((uint64_t *)__pyx_v_bedata)[0]));
      |                                                    ^
psycopg_c/_psycopg.c: In function ‘__pyx_f_9psycopg_c_8_psycopg_17FloatBinaryDumper_cdump’:
psycopg_c/_psycopg.c:56365:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
56365 | __pyx_v_beval = htobe64((((uint64_t *)(&__pyx_v_d))[0]));
      |                                                    ^
psycopg_c/_psycopg.c: In function ‘__pyx_f_9psycopg_c_8_psycopg_18Float4BinaryDumper_cdump’:
psycopg_c/_psycopg.c:56557:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
56557 | __pyx_v_beval = htobe32((((uint32_t *)(&__pyx_v_f))[0]));
      |                                                    ^
psycopg_c/_psycopg.c: In function ‘__pyx_f_9psycopg_c_8_psycopg_19NumericBinaryLoader_cload’:
psycopg_c/_psycopg.c:57961:20: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
57961 |   __pyx_v_digitptr = (__pyx_v_data + (sizeof(__pyx_v_behead)));
      |                    ^
2024-07-03 11:05:38,625 root INFO x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--defsym=__gentoo_check_ldflags__=0 -O3 -pipe -march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=30720 -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -fgraphite-identity -floop-interchange -floop-strip-mine -floop-nest-optimize -ggdb3 -DNDEBUG /var/tmp/portage/dev-python/psycopg-3.1.19/work/psycopg-3.1.19-python3_10/build/temp.linux-x86_64-cpython-310/psycopg_c/pq.o -L/usr/lib64/postgresql-16/lib64 -L/usr/lib64 -lpq -o /var/tmp/portage/dev-python/psycopg-3.1.19/work/psycopg-3.1.19-python3_10/build/lib.linux-x86_64-cpython-310/psycopg_c/pq.cpython-310-x86_64-linux-gnu.so
lto-wrapper: warning: using serial compilation of 6 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
cc1: some warnings being treated as errors
error: command '/usr/bin/x86_64-pc-linux-gnu-gcc' failed with exit code 1
```
Comment 1 Arniii 2024-07-03 11:14:34 UTC
Created attachment 896849 [details]
environment // profile default/linux/amd64/23.0/split-usr/desktop/plasma gcc-13.2.1_p20240210 O3 pipe march=native(verbose) lto graphite ggdb3
Comment 2 Arniii 2024-07-03 11:15:26 UTC
Created attachment 896850 [details]
/etc/portage/make.conf // profile default/linux/amd64/23.0/split-usr/desktop/plasma gcc-13 O3 pipe march=native(verbose) lto graphite ggdb3 testing FEATUREs : testing
Comment 4 Larry the Git Cow gentoo-dev 2024-07-15 08:01:48 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55194e9841234d00a03c2b9d6717c2b8d615dc12

commit 55194e9841234d00a03c2b9d6717c2b8d615dc12
Author:     Eli Schwartz <eschwartz@gentoo.org>
AuthorDate: 2024-07-15 07:52:38 +0000
Commit:     Eli Schwartz <eschwartz@gentoo.org>
CommitDate: 2024-07-15 08:01:31 +0000

    dev-python/psycopg: mark as strict-aliasing unsafe
    
    Closes: https://bugs.gentoo.org/935401
    Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>

 dev-python/psycopg/psycopg-3.1.19.ebuild | 10 +++++++++-
 dev-python/psycopg/psycopg-3.2.0.ebuild  | 10 +++++++++-
 dev-python/psycopg/psycopg-3.2.1.ebuild  | 10 +++++++++-
 3 files changed, 27 insertions(+), 3 deletions(-)