From nobody Tue Apr 11 20:02:41 2023
X-Original-To: tcltk@mlmmj.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
	by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pwxb55LrMz44T64
	for <tcltk@mlmmj.nyi.freebsd.org>; Tue, 11 Apr 2023 20:02:41 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
	 client-signature RSA-PSS (4096 bits) client-digest SHA256)
	(Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK))
	by mx1.freebsd.org (Postfix) with ESMTPS id 4Pwxb53W0xz4Kwy
	for <tcltk@FreeBSD.org>; Tue, 11 Apr 2023 20:02:41 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1681243361;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=6WA6RZktcFJLPCsGfKqUooWZkOSog+NQACqB1SHvRMo=;
	b=hawdQ1GgWojzxr0ajixe94tYVCkFomVi0j+vIM9XKQf4XHjYYhtsPVVZdB/U9j2OoOOUKo
	vs/eKBH3wbtImR9eL8T5DzyFPySF7yHeFMNFLNm363jmQWlore+OLdXOa/qGswjATgFcY/
	Lgs9s+8hdB3xkOX4IRDPfNyP9qSeAPg/qSODbVfsT3PhAdByfM08+rAaD4TwNisTzbz6e0
	9ezDI6bBSioEneM7vhDasLQHWl7PHbPX26UTiLD27sqSwQTf73vSVPU2Fbc6P/zmVpuJs3
	Xro5SE2AOmvpA4ox/+rM3rSQ9s1hA3N0iWk3cSX1DzS0N4vMEcl6L5llI6Hl0A==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681243361; a=rsa-sha256; cv=none;
	b=oD5tzF0Pga37ie4OvuiGWjls1ZOkZ/9jo+DodW2kKrD0cCvB+T+qVD3sPCuuGu29f/JMlV
	aGygv1rXhanjeq4qVyDC0nrq0U1vGBTga1CWIK2gzKbmGQE0v2NkfG4KkR86fb+n7n8Cyl
	iL9ZAaIIHph462fQMbegSUd4Z7Hgp3SpRDsvaZHpQo5ZoGjKGnUaXUjmoBUCBTOxwvO1KX
	uT+kR0ImSLl8KdM0umHO/lszV4C9iJnP1eC1ezQV4qUThBmSNml8N8YtmDAr8kmmL7K3Ar
	2jBTpyX/SVl6VqqTAz4xPdOEYXeHinKg481vA54yl7q1AdNgwoJH63f4Mkksuw==
Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(Client did not present a certificate)
	by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pwxb52cPYzWmc
	for <tcltk@FreeBSD.org>; Tue, 11 Apr 2023 20:02:41 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
Received: from kenobi.freebsd.org ([127.0.1.5])
	by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 33BK2fnd061181
	for <tcltk@FreeBSD.org>; Tue, 11 Apr 2023 20:02:41 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 33BK2fwM061180
	for tcltk@FreeBSD.org; Tue, 11 Apr 2023 20:02:41 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f
From: bugzilla-noreply@freebsd.org
To: tcltk@FreeBSD.org
Subject: [Bug 270768] lang/tcl86: fails to build WITH_LLVM_BINUTILS (LLVM
 strip)
Date: Tue, 11 Apr 2023 20:02:41 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Ports & Packages
X-Bugzilla-Component: Individual Port(s)
X-Bugzilla-Version: Latest
X-Bugzilla-Keywords: 
X-Bugzilla-Severity: Affects Only Me
X-Bugzilla-Who: emaste@freebsd.org
X-Bugzilla-Status: New
X-Bugzilla-Resolution: 
X-Bugzilla-Priority: ---
X-Bugzilla-Assigned-To: tcltk@FreeBSD.org
X-Bugzilla-Flags: maintainer-feedback?
X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform
 op_sys bug_status bug_severity priority component assigned_to reporter
 blocked flagtypes.name
Message-ID: <bug-270768-30738@https.bugs.freebsd.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Id: FreeBSD-specific Tcl/Tk discussions <freebsd-tcltk.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/freebsd-tcltk
List-Help: <mailto:tcltk+help@freebsd.org>
List-Post: <mailto:tcltk@freebsd.org>
List-Subscribe: <mailto:tcltk+subscribe@freebsd.org>
List-Unsubscribe: <mailto:tcltk+unsubscribe@freebsd.org>
Sender: owner-freebsd-tcltk@freebsd.org
X-BeenThere: freebsd-tcltk@freebsd.org
MIME-Version: 1.0
X-ThisMailContainsUnwantedMimeParts: N

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270768

            Bug ID: 270768
           Summary: lang/tcl86: fails to build WITH_LLVM_BINUTILS (LLVM
                    strip)
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: tcltk@FreeBSD.org
          Reporter: emaste@freebsd.org
            Blocks: 258872
          Assignee: tcltk@FreeBSD.org
             Flags: maintainer-feedback?(tcltk@FreeBSD.org)

>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

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

error can be reproduced in isolation:

# strip -o /dev/null -x tclStubLib.o=20
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=20

Symbol table '.symtab' contains 12 entries:
   Num:    Value          Size Type    Bind   Vis       Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT   UND=20
     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_gua=
rd
     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 tclIntPlatStubs=
Ptr
    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.st=
r.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 LL=
VM
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.


Referenced Bugs:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258872
[Bug 258872] [exp-run] WITH_LLVM_BINUTILS
--=20
You are receiving this mail because:
You are the assignee for the bug.=