Summary: | app-emulation/dosemu -fno-pic causes build failure when using hardened compiler with PIE | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Daniel Keyhani <daniel> |
Component: | [OLD] Unspecified | Assignee: | Hanno Böck <hanno> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | flameeyes, hardened, slyfox, stefan.kuhn |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Prposed fix for the ebuild
output of emerge --info dosemu log of unmodified ebuild log with -nopie log with -nopie and my fix for the QA warning |
Description
Daniel Keyhani
2011-11-28 11:58:30 UTC
I can confirme the issue, see attached log file "original.log". The package compiles with -nopie (append-ldflags -nopie), see attachement "with-nopie.log". But then it throws this: * QA Notice: Package triggers severe warnings which indicate that it * may exhibit random runtime failures. * /usr/include/bits/stdio2.h:285:2: warning: call to '__fread_chk_warn' declared with attribute warning: fread called with bigger size * nmemb than length of destination buffer This originates from the first 'fread' statement in src/tools/tools86.c. I think it should be: if (fread(&bsd,sizeof(bsd),1,f) != 1 ) { instead of: if (fread(&bsd,sizeof(gnu),1,f) != 1 ) { Attachement "with-nopie-and-fread-fix.log" contains the final log. Attachement "dosemu-1.4.1_pre20091009.ebuild.patch" contains my fix for the ebuild. Created attachment 333148 [details, diff]
Prposed fix for the ebuild
Created attachment 333150 [details]
output of emerge --info dosemu
Created attachment 333152 [details]
log of unmodified ebuild
Created attachment 333154 [details]
log with -nopie
Created attachment 333156 [details]
log with -nopie and my fix for the QA warning
Opened bug for the severe warning at upstream: https://sourceforge.net/p/dosemu/bugs/466/ It's a gentoo bug. Proper way to filter PIC flags is to use
inherit flag-o-matic
filter-flags -pic
filter-flags has special meaning on hardend toolchains and should add proper flags.
But current dosemu does not seem to need non-pic at all (at least here on amd64).
Although needs MPROTECT and RANDMMAP PaX features disables.
I've pushed the changes as:
>*dosemu-1.4.1_pre20130107-r2 (05 Aug 2013)
>
> 05 Aug 2013; Sergei Trofimovich <slyfox@gentoo.org>
> +dosemu-1.4.1_pre20130107-r2.ebuild, -dosemu-1.4.1_pre20130107-r1.ebuild:
> Added basic hardened support (bug #392261 by Daniel Keyhani).
Please, give it a try. Thanks!
*** Bug 426540 has been marked as a duplicate of this bug. *** |