From the exp-run in PR258872 https://pkg-status.freebsd.org/gohan05/data/mainamd64PR258872-default/2023-04-05_14h36m44s/logs/errors/tcl86-8.6.13.log ========== Installing libtclstub86.a to /wrkdirs/usr/ports/lang/tcl86/work/stage/usr/local/lib/ strip: error: '/wrkdirs/usr/ports/lang/tcl86/work/stage/usr/local/lib/_inst.91375_': not stripping symbol '.L.str.1' because it is named in a relocation *** Error code 1 ========== error can be reproduced in isolation: # strip -o /dev/null -x tclStubLib.o strip: error: 'tclStubLib.o': not stripping symbol '.L.str.1' because it is named in a relocation in this case .L.str.1 is a local symbol: # readelf -s tclStubLib.o Symbol table '.symtab' contains 12 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 FILE LOCAL DEFAULT ABS tclStubLib.c 2: 0000000000000000 0 SECTION LOCAL DEFAULT 2 .text 3: 0000000000000031 4 OBJECT LOCAL DEFAULT 5 .L.str.1 4: 0000000000000000 49 OBJECT LOCAL DEFAULT 5 .L.str 5: 0000000000000000 475 FUNC GLOBAL HIDDEN 2 Tcl_InitStubs 6: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __stack_chk_guard 7: 0000000000000000 8 OBJECT GLOBAL HIDDEN 4 tclStubsPtr 8: 0000000000000008 8 OBJECT GLOBAL HIDDEN 4 tclPlatStubsPtr 9: 0000000000000010 8 OBJECT GLOBAL HIDDEN 4 tclIntStubsPtr 10: 0000000000000018 8 OBJECT GLOBAL HIDDEN 4 tclIntPlatStubsPtr 11: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __stack_chk_fail tcl's build has asked to strip all non-global symbols (strip -x), but .L.str.1 is referenced by relocations: # readelf -r tclStubLib.o | grep .L.str.1 000000000000004e 0000000300000002 R_X86_64_PC32 0000000000000031 .L.str.1 - 4 00000000000000f3 0000000300000002 R_X86_64_PC32 0000000000000031 .L.str.1 - 4 0000000000000153 0000000300000002 R_X86_64_PC32 0000000000000031 .L.str.1 - 4 Both GNU strip and ELF Tool Chain strip silently handle this case (and just retain the local symbol), but LLVM strip is stricter and emits an error upon request to strip a non-removable local symbol. There is an LLVM ticket open for this at https://github.com/llvm/llvm-project/issues/47468. It may make sense for LLVM strip to behave the same as GNU and ELF Tool Chain strip, but I think tcl should just not use strip -x when there are symbols that cannot be stripped. My suggestion would be to just avoid stripping the .a altogether.
Upstream bug report: https://core.tcl-lang.org/tcl/tktview/718de2132f487cf29dfdd0be2b90fcc0107c2aa7
*** Bug 268064 has been marked as a duplicate of this bug. ***
Thanks @emaste - I'm in touch with upstream. We'll see if removing -x is doable for them.
Thank you! In the short term (or if upstream is not agreeable) we could just have tcl use GNU strip for the build, but see PR270663.
Similar issue affects x11-toolkits/tk86
For the record the upstream change was reverted, and it is unclear when a reworked fix will come. What is our appetite for carrying a local patch in the short term?
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=4ef4b555f46b1bddd6600380dbcf0dacb013b95e commit 4ef4b555f46b1bddd6600380dbcf0dacb013b95e Author: Pietro Cerutti <gahr@FreeBSD.org> AuthorDate: 2023-04-24 15:49:14 +0000 Commit: Pietro Cerutti <gahr@FreeBSD.org> CommitDate: 2023-04-24 15:51:34 +0000 lang/tcl8[5-7], x11-toolkits/tk8[5-7]: fix build with WITH_LLVM_BINUTILS PR: 270768 Reported by: emaste lang/tcl85/files/patch-Makefile.in | 9 +++++++++ lang/tcl86/files/patch-unix-Makefile.in | 9 +++++++++ lang/tcl87/files/patch-unix_Makefile.in | 9 +++++++++ x11-toolkits/tk85/files/patch-unix-Makefile.in | 8 ++++++-- x11-toolkits/tk86/files/patch-Makefile.in | 9 +++++++++ x11-toolkits/tk87/files/patch-unix-Makefile.in | 9 +++++++++ 6 files changed, 51 insertions(+), 2 deletions(-)
> What is our appetite for carrying a local patch in the short term? Very hungry :)