Bug 261374 - devel/llvm{13,devel}: Fails to link on riscv64: ld: error: undefined symbol: lldb_private::process_freebsd::NativeRegisterContextFreeBSD
Summary: devel/llvm{13,devel}: Fails to link on riscv64: ld: error: undefined symbol: ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: riscv Any
: --- Affects Many People
Assignee: Brooks Davis
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2022-01-21 12:24 UTC by Piotr Kubaj
Modified: 2022-02-18 19:42 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (brooks)
koobs: merge-quarterly?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer freebsd_triage 2022-01-21 12:24:53 UTC
Linking LLDB fails with:
ld: error: undefined symbol: lldb_private::process_freebsd::NativeRegisterContextFreeBSD::CreateHostNativeRegisterContextFreeBSD(lldb_private::ArchSpec const&, lldb_private::NativeThreadProtocol&)

The same error affects llvm-devel. Workaround would be to disable LLDB.
Comment 1 Joseph Mingrone freebsd_committer freebsd_triage 2022-01-21 16:47:54 UTC
It is possible that Moritz will contribute to RISC-V LLDB support in a few months.  Right now, the top LLDB priorities are 1. usability improvements (which may or may not involve more GDB comparability fixes/additions) and 2. multi-process support.
Comment 2 Brooks Davis freebsd_committer freebsd_triage 2022-01-21 16:51:19 UTC
I'm going to exclude the LLDB option on riscv64. For llvm13 I plan to do it along with the update to 13.0.1 which should be soon (rc2 is out and was supposed to be the final version but at least on fix has been merged to the release branch so I suspect we'll see a short rc3).
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-01-21 19:58:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=dba1bdc3d9dba812f2c012fe08ce59f87f8d99b4

commit dba1bdc3d9dba812f2c012fe08ce59f87f8d99b4
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2022-01-15 01:02:39 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2022-01-21 19:56:24 +0000

    devel/llvm-devel: update to new snapshot

    Disable LLDB on riscv64, there is no support. [0]

    PR:             261374 [0]

 devel/llvm-devel/Makefile          |  6 +++-
 devel/llvm-devel/Makefile.snapshot |  4 +--
 devel/llvm-devel/distinfo          |  6 ++--
 devel/llvm-devel/pkg-plist         | 61 +++++++++++++++++++++++++++-----------
 4 files changed, 53 insertions(+), 24 deletions(-)
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2022-02-07 00:01:52 UTC
Ports/Packages llvm13 is failing to link on riscv64, can this change be backported to all relevent/affected llvm* versions.

[02:03:56] ld: error: undefined symbol: lldb_private::process_freebsd::NativeRegisterContextFreeBSD::CreateHostNativeRegisterContextFreeBSD(lldb_private::ArchSpec const&, lldb_private::NativeThreadProtocol&)
[02:03:56] >>> referenced by NativeThreadFreeBSD.cpp
[02:03:56] >>>               NativeThreadFreeBSD.cpp.o:(lldb_private::process_freebsd::NativeThreadFreeBSD::NativeThreadFreeBSD(lldb_private::process_freebsd::NativeProcessFreeBSD&, unsigned long)) in archive lib/liblldbPluginProcessFreeBSD.a
[02:03:56] c++: error: linker command failed with exit code 1 (use -v to see invocation)

^Triage: This is an unconditional build (link) failure affecting all users of an architecture, Affects Some -> Many
Comment 5 commit-hook freebsd_committer freebsd_triage 2022-02-08 00:35:05 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b00578b9b208edb0f805a1b48e2d217435666f53

commit b00578b9b208edb0f805a1b48e2d217435666f53
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2022-02-08 00:32:27 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2022-02-08 00:32:52 +0000

    devel/llvm13: update to 13.0.1

    Disable FLANG on armv6 and armv7. It's not 32-bit clean and many
    systems lack the RAM to build it natively.

    Disable LLDB on riscv64, there is no riscv64 support. [0]

    PR:             261374 [0]
    MFH:            2022Q1

 devel/llvm13/Makefile                                         |  9 ++++++---
 devel/llvm13/distinfo                                         |  6 +++---
 .../files/patch-llvm_lib_Target_X86_X86InstrSystem.td (gone)  | 11 -----------
 3 files changed, 9 insertions(+), 17 deletions(-)
Comment 6 Brooks Davis freebsd_committer freebsd_triage 2022-02-08 00:39:34 UTC
I plan to MFH tomorrow (the 8th) if I don't get build breakage reports over night.
Comment 7 commit-hook freebsd_committer freebsd_triage 2022-02-08 21:38:40 UTC
A commit in branch 2022Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=fa7265045779fd8912630904113dcaad7f95a852

commit fa7265045779fd8912630904113dcaad7f95a852
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2022-02-08 21:37:24 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2022-02-08 21:37:24 +0000

    devel/llvm13: update to 13.0.1

    Disable FLANG on armv6 and armv7. It's not 32-bit clean and many
    systems lack the RAM to build it natively.

    Disable LLDB on riscv64, there is no riscv64 support. [0]

    PR:             261374 [0]
    MFH:            2022Q1
    (cherry picked from commit b00578b9b208edb0f805a1b48e2d217435666f53)

 devel/llvm13/Makefile                                         |  9 ++++++---
 devel/llvm13/distinfo                                         |  6 +++---
 .../files/patch-llvm_lib_Target_X86_X86InstrSystem.td (gone)  | 11 -----------
 3 files changed, 9 insertions(+), 17 deletions(-)
Comment 8 Brooks Davis freebsd_committer freebsd_triage 2022-02-08 21:46:19 UTC
Is llvm-devel a problem on 2022Q1? If so I can backport the LLDB disabling.
Comment 9 Piotr Kubaj freebsd_committer freebsd_triage 2022-02-09 19:03:56 UTC
Unfortunately, build fails during staging:
/bin/rmdir /wrkdirs/usr/ports/devel/llvm13/work/stage/usr/local/llvm13/share/man/man1/
rmdir: /wrkdirs/usr/ports/devel/llvm13/work/stage/usr/local/llvm13/share/man/man1/: Directory not empty


root@riscv64-default:~ # ls /wrkdirs/usr/ports/devel/llvm13/work/stage/usr/local/llvm13/share/man/man1/
lldb-tblgen.1
Comment 10 commit-hook freebsd_committer freebsd_triage 2022-02-10 18:13:33 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f0a48f0f28c23add582223feb72a8b7d35c548af

commit f0a48f0f28c23add582223feb72a8b7d35c548af
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2022-02-10 18:13:02 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2022-02-10 18:13:02 +0000

    devel/lvm13: fix build without LLDB

    While here, correctly identify several scanbuild-related files as being
    part of clang.

    PR:             261374
    Reported by:    pkubaj

 devel/llvm13/Makefile  |  5 ++++-
 devel/llvm13/pkg-plist | 38 +++++++++++++++++++-------------------
 2 files changed, 23 insertions(+), 20 deletions(-)
Comment 11 commit-hook freebsd_committer freebsd_triage 2022-02-10 18:20:35 UTC
A commit in branch 2022Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1014f85dc2ad6c31c60fff10f39468f5c48a26c0

commit 1014f85dc2ad6c31c60fff10f39468f5c48a26c0
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2022-02-10 18:13:02 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2022-02-10 18:20:04 +0000

    devel/lvm13: fix build without LLDB

    While here, correctly identify several scanbuild-related files as being
    part of clang.

    PR:             261374
    Reported by:    pkubaj

    (cherry picked from commit f0a48f0f28c23add582223feb72a8b7d35c548af)

 devel/llvm13/Makefile  |  5 ++++-
 devel/llvm13/pkg-plist | 38 +++++++++++++++++++-------------------
 2 files changed, 23 insertions(+), 20 deletions(-)