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

Bug 828105

Summary: dev-db/sqlite doesn't build with clang
Product: Gentoo Linux Reporter: 2b57
Component: Current packagesAssignee: Jakov Smolić <jsmolic>
Status: RESOLVED FIXED    
Severity: major CC: base-system, dilfridge, floppym, sam, telans
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 828035    
Bug Blocks: 408963    
Attachments: emerge --info
emerge -pqv
build.log
build.log with CFLAGS+=-U_FORTIFY_SOURCE

Description 2b57 2021-12-03 19:38:06 UTC
Created attachment 757346 [details]
emerge --info

While developing a clang-native system profile I've noticed that Clang cannot compile sqlite package. I guess something is wrong with the patches, because Chimera Linux (Clang-native distro) seems to use different tarball: github. com/chimera-linux/cports/blob/master/main/sqlite/template.py
Comment 1 2b57 2021-12-03 19:38:37 UTC
Created attachment 757347 [details]
emerge -pqv
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-03 19:41:18 UTC
No build log yet? But I bet this is bug 828035.
Comment 3 2b57 2021-12-03 19:41:27 UTC
Created attachment 757348 [details]
build.log
Comment 4 2b57 2021-12-03 20:10:59 UTC
Created attachment 757349 [details]
build.log with CFLAGS+=-U_FORTIFY_SOURCE
Comment 5 James Beddek 2021-12-03 20:22:08 UTC
If you build tcl with -D_FORTIFY_SOURCE=2 and then sqlite with the same, it should work for you.
Comment 6 Michael Egger 2021-12-03 22:07:54 UTC
I had the same issue after upgrading from clang-12 to clang-13.0.0. After downgrading to clang-12.0.1 (because of other issues, mainly firefox) it compiles fine again. Both are without -D_FORTIFY_SOURCE=2
Comment 7 Markus Peloquin 2022-01-13 23:01:46 UTC
In one place, I see 'EST' replaced with '/**'
Another, 'E_HIDDEN_COL' replaced with '/**\n  "COVER'
Another, 'ch is allowe' replaced with '/**\n  "COVER'

It seems like tcl is hitting undefined behavior, maybe writing to buffers that have been freed and realloced. Makes sense that this happens after a new clang release.

Rebuilding tcl with -D_FORTIFY_SOURCE=2 in my CPPFLAGS fixed it.
Comment 8 Arfrever Frehtes Taifersar Arahesis 2022-01-14 01:08:45 UTC
According to Tcl upstream report (https://core.tcl-lang.org/tcl/info/206e58994f3806ec), this problem is supposedly fixed in Tcl 8.6.12.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35afbb0f209e57fdb2362550c2c0c0469503a5e8

commit 35afbb0f209e57fdb2362550c2c0c0469503a5e8
Author:     Alfredo Tupone <tupone@gentoo.org>
AuthorDate: 2021-12-11 21:10:37 +0000
Commit:     Alfredo Tupone <tupone@gentoo.org>
CommitDate: 2021-12-11 21:10:37 +0000

    dev-lang/tcl: 8.6.12 bump
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-02-23 03:15:21 UTC
Fixed version of Tcl is now stable.