Page MenuHomeFreeBSD

archivers/p7zip: Fix build with LLD
ClosedPublic

Authored by mmokhi on Aug 20 2018, 3:30 PM.
Tags
None
Referenced Files
F85647111: D16813.id.diff
Sat, Jun 8, 6:13 PM
F85647108: D16813.id47002.diff
Sat, Jun 8, 6:13 PM
F85647105: D16813.id47305.diff
Sat, Jun 8, 6:13 PM
F85647104: D16813.id46999.diff
Sat, Jun 8, 6:13 PM
F85647101: D16813.id46975.diff
Sat, Jun 8, 6:13 PM
Unknown Object (File)
Fri, Jun 7, 3:22 PM
Unknown Object (File)
Mon, May 20, 5:49 PM
Unknown Object (File)
May 9 2024, 1:46 AM

Details

Summary

This fixes linking error when the LLD is being used as default on i386

@rakuco (maintainer) CC'd to check and hopefully approval :)

Test Plan

poudriere build is fine

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I wonder if this requires a PORTREVISION bump, as it will probably change the package on OSVERSION it built before.

Bump PORTREVISION, reminded by @mat

tobik added inline comments.
archivers/p7zip/Makefile
32–36 ↗(On Diff #46999)

This needs to happen after including bsd.ports.{options,pre}.mk as ARCH is not yet defined at this point, so it cannot be used in an .if as that forces evaluation of it too early:

make: "/usr/ports/archivers/p7zip/Makefile" line 32: Malformed conditional (${ARCH} == "i386")
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/ports/archivers/p7zip

Why not instead use

# Fix the build for i386 when WITH_LLD_IS_LD is set
# https://bugs.freebsd.org/230210
LDFLAGS+=	${LDFLAGS_${ARCH}}
LDFLAGS_i386=	-Wl,-z,notext
mmokhi added inline comments.
archivers/p7zip/Makefile
32–36 ↗(On Diff #46999)

Ah actually I wanted to use LDFLAGS_i386 construct initially (for the sake of simplicity and similarity to `CFLAGS_i386, but I couldn't find anything about it in handbook.
Yup, I'm gonna change it in the way you suggested 😊
Thanks 👍 🙏

Change the LDCONFIG condition with ARCH variable, and make it ifless, thanks to suggestion of @tobik

Approved by maintainer ( rakuco@ ) via Email.

This revision is now accepted and ready to land.Aug 26 2018, 11:06 AM
This revision was automatically updated to reflect the committed changes.