Bug 273998 - devel/elfutils: fix build with lld 17
Summary: devel/elfutils: fix build with lld 17
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Conrad Meyer
URL:
Keywords:
Depends on:
Blocks: 273753
  Show dependency treegraph
 
Reported: 2023-09-21 16:06 UTC by Dimitry Andric
Modified: 2023-10-06 17:55 UTC (History)
0 users

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


Attachments
devel/elfutils: fix build with lld 17 (644 bytes, patch)
2023-09-21 16:06 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2023-09-21 16:06:17 UTC
Building devel/elfutils with lld 17 results in the following link error:

cc -std=gnu99 -Wall -Wshadow -Wformat=2 -Wold-style-definition -Wstrict-prototypes    -Wnull-dereference -Wimplicit-fallthrough -Werror -Wunused -Wextra     -D_FORTIFY_SOURCE=3 -O2 -pipe  -I/usr/local/include -I/usr/local/share/gnulib/lib -Wno-error -Wno-format-nonliteral -Wno-null-dereference -Wno-unused-value -DFREEBSD_HAS_MEMPCPY -fstack-protector-strong -fno-strict-aliasing   /usr/local/lib/libargp.so  /usr/local/lib/libintl.so -fstack-protector-strong  -Wl,--build-id -o libelf.so -shared -Wl,-z,defs -Wl,-z,relro -o libelf.so \
	-Wl,--soname,libelf.so.1 \
	-Wl,--version-script,libelf.map,--no-undefined \
	-Wl,--whole-archive libelf_pic.a -Wl,--no-whole-archive \
	../lib/libeu.a -lz 
ld: error: version script assignment of 'ELFUTILS_1.0' to symbol 'elf_scncnt' failed: symbol not defined
cc: error: linker command failed with exit code 1 (use -v to see invocation)

Upstream removed the symbol which apparently was never implemented in: <https://sourceware.org/git/?p=elfutils.git;a=commit;h=09e61a65953ed814d9e970f7f9ffb9c2d8cda477>. I tried adding this via PATCH_SITES and PATCHFILES, but it looks like the ports framework chokes on URLs with ? in them, so I'm adding a regular patch file in devel/elfutils/files/patch-libelf_libelf.map file instead.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-09-21 16:06:48 UTC
Created attachment 245094 [details]
devel/elfutils: fix build with lld 17
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-10-06 17:52:04 UTC
A commit in branch main references this bug:

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

commit 1a59d78ef32b40408914f9ac2845ecd9d802eebe
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-09-21 16:02:40 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-10-06 17:48:52 +0000

    devel/elfutils: fix build with lld 17

    Building devel/elfutils with lld 17 results in the following link error:

      cc -std=gnu99 -Wall -Wshadow -Wformat=2 -Wold-style-definition -Wstrict-prototypes    -Wnull-dereference -Wimplicit-fallthrough -Werror -Wunused -Wextra     -D_FORTIFY_SOURCE=3 -O2 -pipe  -I/usr/local/include -I/usr/local/share/gnulib/lib -Wno-error -Wno-format-nonliteral -Wno-null-dereference -Wno-unused-value -DFREEBSD_HAS_MEMPCPY -fstack-protector-strong -fno-strict-aliasing   /usr/local/lib/libargp.so  /usr/local/lib/libintl.so -fstack-protector-strong  -Wl,--build-id -o libelf.so -shared -Wl,-z,defs -Wl,-z,relro -o libelf.so \
              -Wl,--soname,libelf.so.1 \
              -Wl,--version-script,libelf.map,--no-undefined \
              -Wl,--whole-archive libelf_pic.a -Wl,--no-whole-archive \
              ../lib/libeu.a -lz
      ld: error: version script assignment of 'ELFUTILS_1.0' to symbol 'elf_scncnt' failed: symbol not defined
      cc: error: linker command failed with exit code 1 (use -v to see invocation)

    Upstream removed the symbol which apparently was never implemented in:
    <https://sourceware.org/git/?p=elfutils.git;a=commit;h=09e61a65953ed814d9e970f7f9ffb9c2d8cda477>.

    I tried adding this via PATCH_SITES and PATCHFILES, but it looks like
    the ports framework chokes on URLs with ? in them, so I'm adding a
    regular patch file in devel/elfutils/files/patch-libelf_libelf.map file
    instead.

    PR:             273998
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2023Q4

 devel/elfutils/files/patch-libelf_libelf.map (new) | 10 ++++++++++
 1 file changed, 10 insertions(+)