Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Nov 2021 15:58:07 +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-mfRraF8Sjs@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

--- Comment #9 from Ed Maste <emaste@freebsd.org> ---
(In reply to Kubilay Kocak from comment #8)
Your assumption is correct, when built with -flto the object file is LLVM IR
rather than ELF.

$ cc -c -flto foo.o
$ file foo.o
foo.o: LLVM IR bitcode

A .a is just an archive of .o files (along with a symbol table), and isn't =
part
of the strip issue per se.

A few points here:

- It usually doesn't make a lot of sense to strip .o or .a files.

- Stripping LLVM IR also doesn't make a lot of sense IMO.

- We could probably have ELF Tool Chain strip detect and ignore bitcode fil=
es -
make no changes and exit with status 0.

- ELF Tool Chain ar can create a .a archive of LLVM IR .o files, but cannot
parse the symbol tables in the .o files to create the archive symbol table.

- Longer term we will presumably migrate to LLVM's ar, nm, strip etc.
(WITH_LLVM_BINUTILS) as it seems unlikely support will be added to ELF Tool
Chain tools.

Given the above I suggest that in the short term we should just stop trying=
 to
strip libffi.a (and other .a archives in ports), and do nothing else until =
we
have migrated to LLVM's tools. Having ELF Tool Chain strip ignore bitcode is
probably straightforward, but it's not that useful if we don't also address=
 ar.

--=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-mfRraF8Sjs>