Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 707078 - 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'
Summary: sys-libs/libcxxabi-14.0.4 fails to compile on arm with: cxa_personality.cpp:5...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM Linux
: Normal normal (vote)
Assignee: LLVM support project
URL: https://reviews.llvm.org/D53127
Whiteboard:
Keywords:
Depends on:
Blocks: 849464
  Show dependency tree
 
Reported: 2020-01-29 09:10 UTC by tt_1
Modified: 2022-08-12 13:29 UTC (History)
3 users (show)

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


Attachments
compressed build log from arm (libxxabi-9.0.1-non-gnu-libunwind.gz,4.53 KB, application/gzip)
2020-01-29 09:10 UTC, tt_1
Details
output from emerge --info (emerge--info,5.25 KB, text/plain)
2020-01-29 09:11 UTC, tt_1
Details
compressed build log from arm with gnu libunwind (libcxxabi-9.0.1-with-gnu-libunwind.gz,4.54 KB, application/gzip)
2020-01-29 12:00 UTC, tt_1
Details
compressed build log with CC=clang and CXX=clang++ (libcxxabi-9.0.1.gz,3.66 KB, application/gzip)
2020-01-30 19:09 UTC, tt_1
Details

Note You need to log in before you can comment on or make changes to this bug.
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.
Comment 16 tt_1 2022-08-12 13:29:17 UTC
I was able to compile libcxxabi-13.0.1 with llvm-libunwind and gcc-9.5.0 toolchain! :D

relevant part of emerge --info

ld GNU ld (Gentoo 2.38 p4) 2.38
app-misc/pax-utils:        1.3.4::gentoo
app-shells/bash:           5.1_p16-r1::gentoo
dev-lang/perl:             5.34.1-r3::gentoo
dev-lang/python:           3.10.6_p2::gentoo
dev-lang/rust:             1.59.0::smaeul
dev-util/cmake:            3.22.4::gentoo
dev-util/meson:            0.62.2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.25::gentoo
sys-devel/autoconf:        2.13-r2::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           13.0.1::gentoo
sys-devel/gcc:             9.5.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/lld:             13.0.1::gentoo
sys-devel/llvm:            13.0.1::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/musl:             1.2.3::gentoo