Page MenuHomeFreeBSD

archivers/p7zip: Fix build with LLD
ClosedPublic

Authored by mmokhi on Aug 20 2018, 3:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 20, 5:49 PM
Unknown Object (File)
Thu, May 9, 1:46 AM
Unknown Object (File)
Sat, May 4, 10:35 AM
Unknown Object (File)
Thu, May 2, 10:24 PM
Unknown Object (File)
Thu, May 2, 10:42 AM
Unknown Object (File)
Apr 30 2024, 6:13 PM
Unknown Object (File)
Apr 29 2024, 9:35 PM
Unknown Object (File)
Apr 27 2024, 7:59 PM

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.