New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 807103 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

We think llvmpipe is not working right now

Project Member Reported by diand...@chromium.org, Jan 30 2018

Issue description

We tried to enable llvmpipe for a new board using:

* This patch to minigbm: https://source.codeaurora.org/quic/lc/chromiumos/platform/minigbm/commit/?h=LC.UM.1.0&id=70d200aa4a7b849685777e74b9124f9c62b1e242

* This patch to the overlaiy: https://source.codeaurora.org/quic/lc/chromiumos/overlays/board-overlays/commit/?h=LC.UM.1.0&id=995260829d45c193d021574664dab90b98c2f642

---

When we did that (and turned on --no-sandbox with "echo '--no-sandbox' >> /etc/chrome_dev.conf"), we saw this error in UI.LATEST:


LLVM ERROR: Program used external function '__aeabi_unwind_cpp_pr1' which could not be resolved!


===


Possibly this is related to recent clang upgrades or possibly to recent changes to the standard C library.

===

* In theory this should be easy to replicate on any arm board where we are trying to use llvmpipe.  

* In theory we should have a builder that can test this so we can make sure we don't break it in the future.



 
See  bug #807099  for the idea that we could create a (slower) softpipe.
Doug, Is P3 correct?
Another useful experiment would be to build mesa with libgcc as well.
i.e. Add these somewhere in src_configure:

append-flags "-rtlib=libgcc"
append-ldflags "-rtlib=libgcc"
@2: If softpipe works, then p3 is probably OK here unless marcheu@ disagrees.  From my point of view this is a stopgap until I can see a real GPU driver.  As I understand it softpipe isn't as good of a stopgap (it's much slower) but hopefully it won't be too long till we get a real GPU driver.

--

@3: Yeah, my plan is to try that this morning.
Cc: norvez@chromium.org puneetster@chromium.org hoegsberg@chromium.org sonnyrao@chromium.org

Comment 6 Deleted

Cc: chadversary@chromium.org
@3: Last night I tried:

--

diff --git a/sys-devel/llvm/llvm-5.0.1.ebuild b/sys-devel/llvm/llvm-5.0.1.ebuild
index ad202fa69994..90268ed75d0b 100644
--- a/sys-devel/llvm/llvm-5.0.1.ebuild
+++ b/sys-devel/llvm/llvm-5.0.1.ebuild
@@ -136,6 +136,11 @@ multilib_src_configure() {
                ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
        fi
 
+       append-ldflags "-rtlib=libgcc"
+       append-cflags "-rtlib=libgcc"
+       append-cxxflags "-rtlib=libgcc"
+
        local libdir=$(get_libdir)
        local mycmakeargs=(
                # disable appending VCS revision to the version to improve

--

I didn't rev the ebuild, but I believe that emerging it manually will make it take effect.  Specifically, after I did the above I did this:

  emerge-cheza sys-devel/llvm mesa && \
  ./build_packages --board=${BOARD} && \
  ./build_image --board=${BOARD} --noenable_rootfs_verification test

With that I still got the same error:

  LLVM ERROR: Program used external function '__aeabi_unwind_cpp_pr1' which could not be resolved!

--

I'm trying one more time with adding "append-flags" too:

diff --git a/sys-devel/llvm/llvm-5.0.1.ebuild b/sys-devel/llvm/llvm-5.0.1.ebuild
index ad202fa69994..90268ed75d0b 100644
--- a/sys-devel/llvm/llvm-5.0.1.ebuild
+++ b/sys-devel/llvm/llvm-5.0.1.ebuild
@@ -136,6 +136,11 @@ multilib_src_configure() {
                ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
        fi
 
+       append-ldflags "-rtlib=libgcc"
+       append-cflags "-rtlib=libgcc"
+       append-cxxflags "-rtlib=libgcc"
+       append-flags "-rtlib=libgcc"
+
        local libdir=$(get_libdir)
        local mycmakeargs=(
                # disable appending VCS revision to the version to improve

--

Yeah, that didn't help either.  Any other ideas?

For now I'm going to move over to seeing if I can get softpipe working.
Doug, did you modify only llvm ebuild Or did you also modify mesa ebuild as well?
Only the llvm ebuild.  Do I need both?
Just as a trial since mesa is the one that invokes llvm.
@11: it's worth a shot.  OK, that did something.  Now I'm back to the crash that was reported earlier!  :)

[   15.859385] llvmpipe-7[2708]: unhandled level 2 translation fault (11) at 0x00000200, esr 0x92000046
[   15.859392] llvmpipe-3[2704]: unhandled level 2 translation fault (11) at 0x00000400, esr 0x92000046
[   15.859398] llvmpipe-4[2705]: unhandled level 2 translation fault (11) at 0x00000500, esr 0x92000046
[   15.859404] llvmpipe-5[2706]: unhandled level 2 translation fault (11) at 0x00000600, esr 0x92000046
[   15.859410] llvmpipe-6[2707]: unhandled level 2 translation fault (11) at 0x000007f0, esr 0x92000006
[   15.859428] CPU: 4 PID: 2706 Comm: llvmpipe-5 Tainted: G        W       4.14.4 #7
[   15.859432] CPU: 1 PID: 2705 Comm: llvmpipe-4 Tainted: G        W       4.14.4 #7
[   15.859434] CPU: 3 PID: 2707 Comm: llvmpipe-6 Tainted: G        W       4.14.4 #7
[   15.859437] CPU: 0 PID: 2704 Comm: llvmpipe-3 Tainted: G        W       4.14.4 #7
[   15.859438] Hardware name: Qualcomm Technologies, Inc. MSM sdm845 MTP (DT)
[   15.859440] Hardware name: Qualcomm Technologies, Inc. MSM sdm845 MTP (DT)
[   15.859442] Hardware name: Qualcomm Technologies, Inc. MSM sdm845 MTP (DT)
[   15.859443] Hardware name: Qualcomm Technologies, Inc. MSM sdm845 MTP (DT)
[   15.859447] task: ffff800172ab2f00 task.stack: ffff0000117b0000
[   15.859449] task: ffff800172ab1f80 task.stack: ffff0000117a8000
[   15.859451] task: ffff80017138dd80 task.stack: ffff0000117b8000
[   15.859453] task: ffff800164519f80 task.stack: ffff0000117a0000
[   15.859456] PC is at 0xec337a70
[   15.859456] PC is at 0xec337a70
[   15.859457] PC is at 0xec336d20
[   15.859458] LR is at 0xf3e75a48
[   15.859459] LR is at 0xf3675a48
[   15.859460] LR is at 0xf26759b8
[   15.859461] pc : [<00000000ec337a70>] lr : [<00000000f3e75a48>] pstate: 20000010
[   15.859463] pc : [<00000000ec337a70>] lr : [<00000000f3675a48>] pstate: 20000010
[   15.859465] pc : [<00000000ec336d20>] lr : [<00000000f26759b8>] pstate: 20000010
[   15.859466] sp : 00000000f3e75960
[   15.859467] sp : 00000000f3675960
[   15.859468] sp : 00000000f26758e0
[   15.859469] x12: 00000000f3e75a4c 
[   15.859470] x12: 00000000f3675a4c 
[   15.859472] x12: 00000000f2675a28 
[   15.859474] x11: 00000000f3e75cf0 
[   15.859475] x11: 00000000f3675cf0 
[   15.859477] x11: 00000000f2675c70 
[   15.859478] x10: 00000000f3e75a40 
[   15.859479] x10: 00000000f3675a40 
[   15.859481] x10: 00000000f26759b0 
[   15.859483] x9 : 00000000f3e75b14 
[   15.859484] x9 : 00000000f3675b14 
[   15.859485] x9 : 00000000f26759b4 
[   15.859487] x8 : 00000000f3e75b18 
[   15.859488] x8 : 00000000f26759a4 
[   15.859490] x7 : 0000000000000000 
[   15.859491] x7 : 00000000000000ff 
[   15.859492] x6 : 00000000000000ff 
[   15.859493] x6 : 00000000000000ff 
[   15.859495] x5 : 0000000000000000 
[   15.859496] x5 : 0000000000000000 
[   15.859498] x4 : 0000000000000000 
[   15.859499] x4 : 0000000000000000 
[   15.859500] x3 : 0000000000000400 
[   15.859502] x3 : 0000000000001680 
[   15.859503] x2 : 0000000000004380 
[   15.859504] x2 : 0000000000004380 
[   15.859506] x1 : 0000000000000400 
[   15.859507] x8 : 00000000f3675b18 
[   15.859508] x1 : 00000000000007f0 
[   15.859509] x0 : 0000000000001680 
[   15.859511] x0 : 00000000000007f0 
[   15.859513] x7 : 0000000000000000 
[   15.859514] x6 : 00000000000000ff 
[   15.859516] x5 : 0000000000000000 x4 : 0000000000000000 
[   15.859519] x3 : 0000000000000500 x2 : 0000000000004380 
[   15.859521] x1 : 0000000000000500 x0 : 0000000000001680 
[   15.859536] PC is at 0xec337a70
[   15.859539] LR is at 0xf2e75a48
[   15.859541] pc : [<00000000ec337a70>] lr : [<00000000f2e75a48>] pstate: 20000010
[   15.859543] sp : 00000000f2e75960
[   15.859545] x12: 00000000f2e75a4c 
[   15.859548] x11: 00000000f2e75cf0 x10: 00000000f2e75a40 
[   15.859552] x9 : 00000000f2e75b14 x8 : 00000000f2e75b18 
[   15.859556] x7 : 0000000000000000 x6 : 00000000000000ff 
[   15.859560] x5 : 0000000000000000 x4 : 0000000000000000 
[   15.859563] x3 : 0000000000000600 x2 : 0000000000004380 
[   15.859566] x1 : 0000000000000600 x0 : 0000000000001680 
[   16.221347] CPU: 2 PID: 2708 Comm: llvmpipe-7 Tainted: G        W       4.14.4 #7
[   16.228905] Hardware name: Qualcomm Technologies, Inc. MSM sdm845 MTP (DT)
[   16.235852] task: ffff800171389000 task.stack: ffff0000117c0000
[   16.241832] PC is at 0xec337a70
[   16.245018] LR is at 0xf1e75a48
[   16.248196] pc : [<00000000ec337a70>] lr : [<00000000f1e75a48>] pstate: 20000010
[   16.255665] sp : 00000000f1e75960
[   16.259021] x12: 00000000f1e75a4c 
[   16.262471] x11: 00000000f1e75cf0 x10: 00000000f1e75a40 
[   16.267840] x9 : 00000000f1e75b14 x8 : 00000000f1e75b18 
[   16.273211] x7 : 0000000000000000 x6 : 00000000000000ff 
[   16.278579] x5 : 0000000000000000 x4 : 0000000000000000 
[   16.283948] x3 : 0000000000000200 x2 : 0000000000004380 
[   16.289317] x1 : 0000000000000200 x0 : 0000000000001680 
[   16.426055] dsi-ctrl:[dsi_ctrl_handle_error_status] dsi_ctrl_handle_error_status: 64
[   16.697369] [drm:sde_kms_complete_commit:579] Connector Post kickoff failed rc=-22
[   16.729767] msm ae00000.qcom,mdss_mdp: no adreno device
[   16.799390] msm ae00000.qcom,mdss_mdp: no adreno device
[   16.807696] msm ae00000.qcom,mdss_mdp: no adreno device
[   17.743395] msm-dsi-panel:[dsi_panel_parse_topology:2321] default topology: lm: 2 comp_enc:2 intf: 1
[   17.770779] [drm:sde_encoder_helper_wait_for_irq:367] [sde error]enc27 intf2 pp0 encoder is disabled
[   17.872283] dsi-ctrl:[dsi_ctrl_setup_isr] [DSI_1] IRQ 92 registered

In case it's helpful, here's my hacky patch that I was using:

https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/893540
Labels: Build-Toolchain
FYI that now that I've fixed the graphics stack on the board I was testing with, I've got llvmpipe working.  I'm currently trying to biesect exactly which places I need to add "-rtlib=libgcc" to.  When I have something I'll post it here.
What -rtlib=libgcc do is: Link with libgcc_s.so (shared) vs libgcc_eh.a (static).  Both should provide the unwinding symbols.

I have no idea why this makes a difference to llvmpipe.
So far I've confirmed that adding this to the _mess_ ebuild works:

        append-ldflags "-rtlib=libgcc"
        append-flags "-rtlib=libgcc"

...but I don't seem to need to add it to the "llvm" ebuild.  I'm currently trying to see if I need _both_ of those or if I only need one of them.
OK, updated https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/893540.  If folks are happy with that then we can land it.
We're landing the workaround.  Opened bug #808264 to track removing the workaround when someone can root cause.
Project Member

Comment 20 by bugdroid1@chromium.org, Feb 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/9e2e314e5bd303540e65515e19375a30eb5e2e84

commit 9e2e314e5bd303540e65515e19375a30eb5e2e84
Author: Douglas Anderson <dianders@chromium.org>
Date: Fri Feb 02 11:40:26 2018

media-libs/mesa: Fix llvmpipe on arm

When our graphics card was llvmpipe and we tried to start the UI, we'd
see in the logs:

LLVM ERROR: Program used external function '__aeabi_unwind_cpp_pr1'
which could not be resolved!

This seems related to clang upgrades and/or the migration to libc++

It was suggested that adding the "-rtlib=libgcc" flag would fix the
problem and, indeed, it did.

BUG= chromium:807103 
TEST=See bug

Change-Id: I72748e53f8fe9b6757309fb264c8fd25354cfa8c
Reviewed-on: https://chromium-review.googlesource.com/893540
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/9e2e314e5bd303540e65515e19375a30eb5e2e84/media-libs/mesa/mesa-17.2.3.ebuild
[modify] https://crrev.com/9e2e314e5bd303540e65515e19375a30eb5e2e84/media-libs/mesa/mesa-9999.ebuild
[rename] https://crrev.com/9e2e314e5bd303540e65515e19375a30eb5e2e84/media-libs/mesa/mesa-17.2.3-r18.ebuild

Labels: M-66
Status: Fixed (was: Untriaged)
Marking this as Fixed.  Repeating the above: Opened bug #808264 to track removing the workaround when someone can root cause.

Sign in to add a comment