Page MenuHomeFreeBSD

lang/ocaml: add -znotext to LDFLAGS on i386, for lld
ClosedPublic

Authored by emaste on Sep 17 2018, 2:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 20, 1:21 PM
Unknown Object (File)
Mar 21 2024, 3:30 AM
Unknown Object (File)
Feb 12 2024, 4:01 PM
Unknown Object (File)
Feb 7 2024, 7:11 AM
Unknown Object (File)
Feb 7 2024, 4:23 AM
Unknown Object (File)
Jan 27 2024, 12:53 PM
Unknown Object (File)
Jan 27 2024, 12:53 PM
Unknown Object (File)
Jan 27 2024, 12:53 PM

Details

Summary

Example error:

/usr/bin/ld: error: can't create dynamic relocation R_386_32 against symbol: caml_last_return_address 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.

Diff Detail

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

Event Timeline

lang/ocaml/Makefile
37 ↗(On Diff #48112)

Couldn’t this be eliminated and only have the LDFLAGS_i386....?

emaste added inline comments.
lang/ocaml/Makefile
37 ↗(On Diff #48112)

Common ports infrastructure doesn't handle arch-specific LDFLAGS the way it does CFLAGS_${ARCH}

ndowens_yahoo.com added inline comments.
lang/ocaml/Makefile
37 ↗(On Diff #48112)

Just found that out as well, never mind

lang/ocaml/Makefile
38 ↗(On Diff #48112)

Only thing I would change is the order as declaring a variable should come before its use

This revision was not accepted when it landed; it landed in state Needs Review.Sep 18 2018, 4:05 PM
This revision was automatically updated to reflect the committed changes.