Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 759331 - app-emulation/qemu-5.2.0 fails to compile
Summary: app-emulation/qemu-5.2.0 fails to compile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Matthias Maier
URL:
Whiteboard:
Keywords:
: 759334 759364 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-12-10 10:29 UTC by Agostino Sarubbo
Modified: 2020-12-10 23:35 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.xz (build.log.xz,46.87 KB, application/x-xz)
2020-12-10 10:29 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2020-12-10 10:29:25 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: app-emulation/qemu-5.2.0 fails to compile.
Discovered on: amd64 (internal ref: ci)
Comment 1 Agostino Sarubbo gentoo-dev 2020-12-10 10:29:28 UTC
Created attachment 677557 [details]
build.log.xz

build log and emerge --info (compressed because it exceeds attachment limit, use 'xzless' to read it)
Comment 2 Agostino Sarubbo gentoo-dev 2020-12-10 10:29:29 UTC
Possible context of error(s):

coroutine-ucontext.c:(.text+0x104): undefined reference to `__safestack_unsafe_stack_ptr'
coroutine-ucontext.c:(.text+0x104): undefined reference to `__safestack_unsafe_stack_ptr'
coroutine-ucontext.c:(.text+0x104): undefined reference to `__safestack_unsafe_stack_ptr'
coroutine-ucontext.c:(.text+0x104): undefined reference to `__safestack_unsafe_stack_ptr'
coroutine-ucontext.c:(.text+0x104): undefined reference to `__safestack_unsafe_stack_ptr'
coroutine-ucontext.c:(.text+0x104): undefined reference to `__safestack_unsafe_stack_ptr'
coroutine-ucontext.c:(.text+0x104): undefined reference to `__safestack_unsafe_stack_ptr'
coroutine-ucontext.c:(.text+0x104): undefined reference to `__safestack_unsafe_stack_ptr'
coroutine-ucontext.c:(.text+0x104): undefined reference to `__safestack_unsafe_stack_ptr'
coroutine-ucontext.c:(.text+0x104): undefined reference to `__safestack_unsafe_stack_ptr'
collect2: error: ld returned 1 exit status
Comment 3 Ionen Wolkens gentoo-dev 2020-12-10 11:37:04 UTC
I believe this is already fixed by:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=541bb02a46aa817953c29c8ffef222bbfb58ebd8
Comment 4 Agostino Sarubbo gentoo-dev 2020-12-10 11:41:54 UTC
the build log indicates that it was merged at the commit you pointed out, so no, that commit introduces the issue for me.
Comment 5 Ionen Wolkens gentoo-dev 2020-12-10 11:44:52 UTC
(In reply to Agostino Sarubbo from comment #4)
> the build log indicates that it was merged at the commit you pointed out, so
> no, that commit introduces the issue for me.
Yes, I was just about to correct myself. Sorry for the noise.
Comment 6 Agostino Sarubbo gentoo-dev 2020-12-10 11:55:52 UTC
*** Bug 759334 has been marked as a duplicate of this bug. ***
Comment 7 Ionen Wolkens gentoo-dev 2020-12-10 12:57:31 UTC
Seems the compiled code fails _if_ safestack feature is found, then adequately disable safe_stack if succeeded.

int main(int argc, char *argv[])
{
#if defined(__has_feature)
#if __has_feature(safe_stack)
#error SafeStack Enabled
#endif
#endif
    return 0;
}

Don't know what prompted adding this patch but it doesn't looked needed. qemu-5.1.0 also tested for this the same way.
Comment 8 Larry the Git Cow gentoo-dev 2020-12-10 14:59:21 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6fd8b254b1822d231fdc94b02dbf2635bc7b4bfc

commit 6fd8b254b1822d231fdc94b02dbf2635bc7b4bfc
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-12-10 14:56:15 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-12-10 14:59:16 +0000

    profiles/package.mask: mask qemu-5.2.0 for testing
    
    Bug: https://bugs.gentoo.org/759331
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 profiles/package.mask | 5 +++++
 1 file changed, 5 insertions(+)
Comment 9 Larry the Git Cow gentoo-dev 2020-12-10 15:03:10 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ef9e5361d90e4a3b60da326db292bdd13322529

commit 3ef9e5361d90e4a3b60da326db292bdd13322529
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-12-10 15:01:02 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-12-10 15:03:03 +0000

    app-emulation/qemu: revert "fix safe-stack feature detection"
    
    I misinterpreted what test does. Will need to check why it passes for me.
    Reverting it for now.
    
    This reverts commit 541bb02a46aa817953c29c8ffef222bbfb58ebd8.
    
    Reported-by: Agostino Sarubbo
    Closes: https://bugs.gentoo.org/759331
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 app-emulation/qemu/files/qemu-5.2.0-safe-stack.patch | 12 ------------
 app-emulation/qemu/qemu-5.2.0.ebuild                 |  1 -
 2 files changed, 13 deletions(-)
Comment 10 Harri Nieminen (Moiman) 2020-12-10 16:25:03 UTC
*** Bug 759364 has been marked as a duplicate of this bug. ***
Comment 11 Sergei Trofimovich (RETIRED) gentoo-dev 2020-12-10 23:35:43 UTC
(In reply to Ionen Wolkens from comment #7)
> Seems the compiled code fails _if_ safestack feature is found, then
> adequately disable safe_stack if succeeded.
> 
> int main(int argc, char *argv[])
> {
> #if defined(__has_feature)
> #if __has_feature(safe_stack)
> #error SafeStack Enabled
> #endif
> #endif
>     return 0;
> }
> 
> Don't know what prompted adding this patch but it doesn't looked needed.
> qemu-5.1.0 also tested for this the same way.

I misinterpreted the test. This code also fails to compile with -Werror and a warning-enabling flag in CFLAGS, say -Wall -Wextra (I happen to have those set). And that triggers safe stack mis-detection.