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

Bug 707078

Summary: sys-libs/libcxxabi-14.0.4 fails to compile on arm with: cxa_personality.cpp:573:22: error: '_URC_FATAL_PHASE1_ERROR' was not declared in this scope'
Product: Gentoo Linux Reporter: tt_1 <herrtimson>
Component: Current packagesAssignee: LLVM support project <llvm>
Status: CONFIRMED ---    
Severity: normal CC: arm, mgorny, sam
Priority: Normal    
Version: unspecified   
Hardware: ARM   
OS: Linux   
URL: https://reviews.llvm.org/D53127
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 849464    
Attachments: compressed build log from arm
output from emerge --info
compressed build log from arm with gnu libunwind
compressed build log with CC=clang and CXX=clang++

Description tt_1 2020-01-29 09:10:47 UTC
Created attachment 607316 [details]
compressed build log from arm

this was compiled using gcc and llvm-libunwind-9.0.1

output from the build log:

cat /var/tmp/portage/sys-libs/libcxxabi-9.0.1/temp/build.log | grep error: -b1
36162-/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp: In function 'void __cxxabiv1::scan_eh_tab(__cxxabiv1::{anonymous}::scan_results&, _Unwind_Action, bool, _Unwind_Control_Block*, _Unwind_Context*)':
36392:/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp:573:22: error: '_URC_FATAL_PHASE1_ERROR' was not declared in this scope
36545-  573 |     results.reason = _URC_FATAL_PHASE1_ERROR;
36599-      |                      ^~~~~~~~~~~~~~~~~~~~~~~
36652:/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp:593:30: error: '_URC_FATAL_PHASE2_ERROR' was not declared in this scope
36805-  593 |             results.reason = _URC_FATAL_PHASE2_ERROR;
--
36928-/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp: In function '_Unwind_Reason_Code __cxxabiv1::__gxx_personality_v0(_Unwind_State, _Unwind_Control_Block*, _Unwind_Context*)':
37135:/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp:1098:16: error: '_URC_FATAL_PHASE1_ERROR' was not declared in this scope
37289- 1098 |         return _URC_FATAL_PHASE1_ERROR;
37337-      |                ^~~~~~~~~~~~~~~~~~~~~~~
37384:/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp:1111:11: error: invalid conversion from 'int' to '_Unwind_State' [-fpermissive]
37545- 1111 |     state &= ~_US_FORCE_UNWIND;
--
38053-/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp:1114:12: warning: enumeration value '_US_END_OF_STACK' not handled in switch [-Wswitch]
38222:/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp:1191:12: error: '_URC_FATAL_PHASE1_ERROR' was not declared in this scope


relying on sys-libs/libunwind doesn't work either and fails with a different error.
Comment 1 tt_1 2020-01-29 09:11:09 UTC
Created attachment 607318 [details]
output from emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2020-01-29 09:20:06 UTC
I got this error during the arch test but for lack of time I didn't report it. I'm wondering why it was marked stable (our error or it fails on certain arm platform?)
Comment 3 tt_1 2020-01-29 10:20:29 UTC
it seems that _URC_FATAL_PHASE1_ERROR isn't implemented

are you a dev and can pick this up to upstream? Because I can't really :-S
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-01-29 10:34:33 UTC
Is this using sys-libs/libunwind or sys-libs/llvm-libunwind?  Could you try the other for comparison?
Comment 5 tt_1 2020-01-29 11:58:12 UTC
the initial log is with llvm-libunwind-9.0.1, here's with sys-libs/libunwind-1.2.1-r3: 

cat  /var/tmp/portage/sys-libs/libcxxabi-9.0.1/temp/build.log | grep error: -b1
36161-/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp: In function 'void __cxxabiv1::scan_eh_tab(__cxxabiv1::{anonymous}::scan_results&, _Unwind_Action, bool, _Unwind_Control_Block*, _Unwind_Context*)':
36391:/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp:573:22: error: '_URC_FATAL_PHASE1_ERROR' was not declared in this scope
36544-  573 |     results.reason = _URC_FATAL_PHASE1_ERROR;
36598-      |                      ^~~~~~~~~~~~~~~~~~~~~~~
36651:/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp:593:30: error: '_URC_FATAL_PHASE2_ERROR' was not declared in this scope
36804-  593 |             results.reason = _URC_FATAL_PHASE2_ERROR;
--
36927-/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp: In function '_Unwind_Reason_Code __cxxabiv1::__gxx_personality_v0(_Unwind_State, _Unwind_Control_Block*, _Unwind_Context*)':
37134:/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp:1098:16: error: '_URC_FATAL_PHASE1_ERROR' was not declared in this scope
37288- 1098 |         return _URC_FATAL_PHASE1_ERROR;
37336-      |                ^~~~~~~~~~~~~~~~~~~~~~~
37383:/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp:1111:11: error: invalid conversion from 'int' to '_Unwind_State' [-fpermissive]
37544- 1111 |     state &= ~_US_FORCE_UNWIND;
--
38052-/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp:1114:12: warning: enumeration value '_US_END_OF_STACK' not handled in switch [-Wswitch]
38221:/var/tmp/portage/sys-libs/libcxxabi-9.0.1/work/libcxxabi/src/cxa_personality.cpp:1191:12: error: '_URC_FATAL_PHASE1_ERROR' was not declared in this scope
38375- 1191 |     return _URC_FATAL_PHASE1_ERROR;

which seems identical to me?
Comment 6 tt_1 2020-01-29 12:00:16 UTC
Created attachment 607322 [details]
compressed build log from arm with gnu libunwind
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-01-29 12:21:28 UTC
Could you try building with clang (CC=clang CXX=clang++)?
Comment 8 tt_1 2020-01-29 12:42:00 UTC
This is most likely going to work, as fedora ships their binaries of libcxx{abi} for arm built with clang by default, but I don't have clang emerged at the moment. 

Do you really need this for confirmation? I mean, it takes some 20hrs to build it, including a lot of swapping :-S
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-01-29 12:44:24 UTC
Well, my guess is that gcc ships and uses broken unwind.h.
Comment 10 tt_1 2020-01-29 13:19:14 UTC
Ok, I started to emerge clang now, results not before tomorrow. 

@Agostino Sarubbo if you happen to have clang already available, could you please provide the proof that it works with CC=clang and CXX=clang++ ?
Comment 11 tt_1 2020-01-30 19:09:17 UTC
Created attachment 608796 [details]
compressed build log with CC=clang and CXX=clang++

seems to work with clang, so can you imagine to introduce a clang use flag just as in compiler-rt, merely to mitigate the problem?
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-09-21 16:21:53 UTC
Still an issue with 10.0.1.
Comment 13 tt_1 2020-09-26 18:55:32 UTC
only the gcc backend is broken, you can use clang as a workaround

I'm unable to fix the bug upstream, so it might be a good idea to set clang useflag for mitigation?
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-30 00:38:00 UTC
Still with 11.1.0.
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-05 20:06:47 UTC
(In reply to Sam James from comment #14)
> Still with 11.1.0.

...and 13.0.0.