Bug 267119 - x11-wm/awesome breaks with clang14 (CURRENT)
Summary: x11-wm/awesome breaks with clang14 (CURRENT)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexandre C. Guimarães
URL: http://github.com/awesomewm/awesome
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-16 10:51 UTC by Jonathan Reynolds
Modified: 2022-10-22 19:25 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (rigoletto)


Attachments
Fix linker flags -export-dynamic (463 bytes, patch)
2022-10-16 12:59 UTC, Jonathan Reynolds
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Reynolds 2022-10-16 10:51:06 UTC
(lldb) target create "./awesome"
Current executable set to '/wrkdirs/usr/ports/x11-wm/awesome/work/.build/awesome' (x86_64).
(lldb) b main
Breakpoint 1: where = awesome`main + 45 at awesome.c:572:13, address = 0x00000000002191ad
(lldb) r
Process 86160 launched: '/wrkdirs/usr/ports/x11-wm/awesome/work/.build/awesome' (x86_64)
Process 86160 stopped
* thread #1, name = 'awesome', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    frame #0: 0x0000000000000000
error: memory read failed for 0x0

Using clang13 or gcc11 solves the issue.
Comment 1 Jonathan Reynolds 2022-10-16 11:02:05 UTC
Found the error message.

ld: warning: cannot find entry symbol xport-dynamic; not setting start address
Comment 2 Jonathan Reynolds 2022-10-16 11:56:51 UTC
clang-13: error: unsupported option '--export-dynamic'

from ld:
     --export-dynamic, -E
             Put symbols in the dynamic symbol table

@${REINPLACE_CMD} -e "s/-export-dynamic/\"-Xlinker -E\"/" \
        ${WRKSRC}/CMakeLists.txt

The above line solve the issue.

Sorry for not providing a patch.
I already patched with a non-existent port bug #267105
Comment 3 Jonathan Reynolds 2022-10-16 12:59:42 UTC
Created attachment 237378 [details]
Fix linker flags -export-dynamic

clang-13: error: unsupported option '--export-dynamic'

from ld(1)
     --export-dynamic, -E
             Put symbols in the dynamic symbol table.
proposed fix:
+       @${REINPLACE_CMD} -e "s/-export-dynamic/\"-Xlinker -E\"/" \
+               ${WRKSRC}/CMakeLists.txt
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-10-22 19:14:33 UTC
A commit in branch main references this bug:

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

commit 18d2762dc269d461fb51ee0235b8b8b1c212190b
Author:     Alexandre C. Guimarães <rigoletto@FreeBSD.org>
AuthorDate: 2022-10-22 19:12:24 +0000
Commit:     Alexandre C. Guimarães <rigoletto@FreeBSD.org>
CommitDate: 2022-10-22 19:12:24 +0000

    x11-wm/awesome: Fix build with clang14 (CURRENT)

    PR:             267119
    Reported by:    Jonathan Reynolds <jreynolds1729@gmail.com>

 x11-wm/awesome/Makefile | 4 ++++
 1 file changed, 4 insertions(+)
Comment 5 Alexandre C. Guimarães freebsd_committer freebsd_triage 2022-10-22 19:16:40 UTC
Thank you! :-)
Comment 6 Jonathan Reynolds 2022-10-22 19:25:56 UTC
(In reply to Alexandre C. Guimarães from comment #5)
My pleasure.