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

Bug 636604

Summary: sys-libs/compiler-rt-sanitizers: -D_FORTIFY_SOURCE=2 flag gives error: redefinition of 'realpath'
Product: Gentoo Linux Reporter: Haelwenn (lanodan) Monnier <contact>
Component: Current packagesAssignee: LLVM support project <llvm>
Status: RESOLVED FIXED    
Severity: normal CC: aptx945, herrtimson, lssndrbarbieri, z23
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/19788
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: lzma /var/tmp/portage/sys-libs/compiler-rt-sanitizers-4.0.1/temp/build.log

Description Haelwenn (lanodan) Monnier 2017-11-05 11:51:03 UTC
When building with '-D_FORTIFY_SOURCE=2' in the CLFAGS/CXXFLAGS the build fails, when the flag isn’t present the build doesn’t fail.

I found this issue (http://llvm.1065342.n5.nabble.com/llvm-dev-Thin-LTO-llvm-build-td100633i120.html) leading me to it.
Comment 1 Haelwenn (lanodan) Monnier 2017-11-05 11:58:43 UTC
Created attachment 502690 [details]
lzma /var/tmp/portage/sys-libs/compiler-rt-sanitizers-4.0.1/temp/build.log
Comment 2 Haelwenn (lanodan) Monnier 2018-02-20 03:51:36 UTC
I have this bug again on 5.0.1 btw.
Comment 3 Derek Dolney 2020-03-09 02:36:06 UTC
I have the same problem with 8.0.1.

-D_FORTIFY_SOURCE=1 doesn't work either.
Comment 4 OwenJia 2020-07-22 09:06:19 UTC
I have the same problem with 10.0.1.

FYI:
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -frename-registers -fstack-clash-protection -D_FORTIFY_SOURCE=2"
Comment 5 Haelwenn (lanodan) Monnier 2021-03-06 09:42:27 UTC
btw https://bugs.llvm.org/show_bug.cgi?id=47163 seems to be related.
Comment 6 Alessandro Barbieri 2021-03-25 12:32:31 UTC
I can build it with GCC hardened
Comment 7 Larry the Git Cow gentoo-dev 2021-04-24 09:43:45 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20fcc3fcd7ca910136a74dee6b951154a203a7ee

commit 20fcc3fcd7ca910136a74dee6b951154a203a7ee
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2021-04-24 09:38:41 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2021-04-24 09:43:42 +0000

    sys-libs/compiler-rt-sanitizers: Backport -D_FORTIFY_SOURCE fix
    
    Closes: https://bugs.gentoo.org/636604
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 sys-libs/compiler-rt-sanitizers/Manifest                            | 6 +++---
 ...tizers-10.0.1.ebuild => compiler-rt-sanitizers-10.0.1-r1.ebuild} | 2 +-
 ...tizers-11.0.0.ebuild => compiler-rt-sanitizers-11.0.0-r1.ebuild} | 2 +-
 ...tizers-11.0.1.ebuild => compiler-rt-sanitizers-11.0.1-r1.ebuild} | 2 +-
 ...tizers-11.1.0.ebuild => compiler-rt-sanitizers-11.1.0-r1.ebuild} | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)