Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Oct 2021 06:03:13 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 258820] Multiple ports fail to build with USE_LTO: libffi.a strip: file format not recognized (propose: disable building static library)
Message-ID:  <bug-258820-7788-wMQFhWEiEW@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-258820-7788@https.bugs.freebsd.org/bugzilla/>
References:  <bug-258820-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258820

Kubilay Kocak <koobs@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://github.com/InBetwee
                   |                            |nNames/gentooLTO/issues/49
                 CC|                            |dim@FreeBSD.org,
                   |                            |emaste@freebsd.org
              Flags|                            |maintainer-feedback?(emaste
                   |                            |@freebsd.org),
                   |                            |maintainer-feedback?(dim@Fr
                   |                            |eeBSD.org)

--- Comment #8 from Kubilay Kocak <koobs@FreeBSD.org> ---
(In reply to Daniel Engberg from comment #7)

Separating packages is orthogonal to addressing the root problem, sweeping =
the
issue/question to a -static subpackage/flavor build.

The root issue appears to be elftoolchain strip not understanding LLVM IR f=
rom
LTO builds in or for static libraries. It may turn out that strip tools
'shouldnt' need to support stripping LTO-d static libraries, but I haven't
found evidence that this is the case.

So far I've additionally tried:

 - llvm-strip / llvm-objcopy --strip-debug (14.0-CURRENT #2
main-n249859-248682a5891)

   error:
'/var/tmp/tmpfs0/usr/ports/devel/libuv/work/stage/usr/local/lib/libuv.a(lib=
uv_la-fs-poll.o)':
The file was not recognized as a valid object file

 - binutils: strip*:=20

   Unable to recognise the format of file: file format not recognized (Note:
this error is not fatal.)

 - Notable also, llvm-nm reports no errors on the same file.

I've been hunting authoritative upstream (llvm) references for bug reports =
or
commits that hint at this issue, or how one should handle it, but haven't q=
uite
identified anything precisely on target.

Feedback from Ed (for elftoolchain), and Dim (for LLVM) would be great for
leads here.

The ideal outcome here is the ability to strip debug symbols from static
libraries built with LTO(thin), and ideally with the toolchain FreeBSD expe=
cts
to have in the long-term (llvm's).

If that turns out to require some tweaks to upstream LLVM/Clang tools, then=
 we
may be able to separately port llvm-strip (with the fixes) until all suppor=
ted
LLVM/Clang releases in base contain the appropriately fixed versions.
Alternatively, have elftoolchain's strip support it in the short term, and =
have
that in ports, if its not there already.

Failing that, and down the list of desired partial resolutions, we could us=
e a
STRIP_MASK style setup for the strip framework mechanism, that supports
excluding static libraries. Gentoo did this in the past when GNU strip was
mangling static libraries [1] and its probably useful for us for other reas=
ons
too.

[1] https://github.com/InBetweenNames/gentooLTO/issues/49

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-258820-7788-wMQFhWEiEW>