Page MenuHomeFreeBSD

multimedia/libx264: add -znotext to LDFLAGS on i386, for lld
ClosedPublic

Authored by emaste on Sep 17 2018, 3:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 22, 11:55 AM
Unknown Object (File)
Fri, Dec 13, 3:36 AM
Unknown Object (File)
Tue, Dec 3, 1:45 PM
Unknown Object (File)
Mon, Dec 2, 11:11 PM
Unknown Object (File)
Wed, Nov 27, 10:33 PM
Unknown Object (File)
Nov 25 2024, 6:42 AM
Unknown Object (File)
Oct 18 2024, 12:43 PM
Unknown Object (File)
Oct 18 2024, 7:38 AM

Details

Summary

Example error:

/usr/bin/ld: error: can't create dynamic relocation R_386_PC32 against symbol: gettimeofday in readonly segment; recompile object files with -fPIC

This port links some non-PIC code, which fails with lld as it defaults to disallowing relocations against read-only segments. For i386 we can just add -znotext unconditionally: for GNU BFD ld it just affirms BFD's existing default.

Original version committed in rS479024, this review represents a preferred approach.

I am not a ports committer, so please explicitly mention approval for commit to the ports tree.

Diff Detail

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

Event Timeline

multimedia/libx264/Makefile
17 ↗(On Diff #48114)

Reverse line 17 and 18 so it’s declared before variable is used

The variable substitution/evaluation is done at the end so it works both ways; my natural tendency would be to put them in the other order but this was the one used in the first instance of this approach in review D16813 / rP478120 by @mmokhi.

Any change fixing this issue was (and is) explicitly approved (subject to @emaste confidence in solution/QA) per bugzilla issue comment: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230214#c7

This revision is now accepted and ready to land.Sep 18 2018, 3:02 AM
multimedia/libx264/Makefile
17 ↗(On Diff #48114)

Does this need to be wrapped in a if defined(${LDFLAGS_${ARCH}}) block to protect a failure if the variable is not defined for the ARCH the port is being built on?

tobik added inline comments.
multimedia/libx264/Makefile
17 ↗(On Diff #48114)

Why? ${LDFLAGS_${ARCH}} for some ARCH != i386 evals to an empty string, so all is good.

This revision was automatically updated to reflect the committed changes.