Page MenuHomeFreeBSD

archivers/p7zip: Fix build with LLD
ClosedPublic

Authored by mmokhi on Aug 20 2018, 3:30 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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mmokhi created this revision.Aug 20 2018, 3:30 PM
mat added a comment.Aug 20 2018, 8:35 PM

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

mmokhi updated this revision to Diff 46999.Aug 20 2018, 8:47 PM

Bump PORTREVISION, reminded by @mat

tobik added a subscriber: tobik.Aug 20 2018, 9:14 PM
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 marked an inline comment as done.Aug 20 2018, 9:21 PM
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 👍 🙏

mmokhi marked 2 inline comments as done.Aug 20 2018, 9:24 PM
mmokhi updated this revision to Diff 47002.Aug 20 2018, 9:29 PM

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

mmokhi accepted this revision.Aug 26 2018, 11:06 AM

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.