ports/print/openprinting/files/patch-ltmain.sh
Ed Maste db43eccd90 print/openprinting: fix build when lld is the system linker
This port passes an invalid argument -Mmapfile to the linker.  Per GNU
BFD ld's manpage, link map options are -M or --print-map to print a link
map to stdout, or -Map mapfile to print a link map to mapfile.

It appears that ld.bfd accepts -Mmapfile as a synonym for -M due to some
quirk of its parser; lld simply fails with an unknown argument error.

This port's embedded copy of libtool was also too old to know that it
should pass the -fuse-ld flag from LDFLAGS through to the linker, and
also too old to match the sed expression in Mk/Uses/libtool.mk that
patches in knowledge of -fuse-ld.  Thus, patch ltmain.sh to add
-fuse-ld=bfd as a passthrough flag.

I do not know why libtool's authors believed that silently dropping
flags from a user's provided LDFLAGS was (is) a sensible thing to do.

PR:		221809
Approved by:	ler
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D14968
2018-04-05 02:43:07 +00:00

14 lines
300 B
Bash

--- ltmain.sh.orig 2018-04-04 21:26:22.534684000 -0400
+++ ltmain.sh 2018-04-04 21:26:32.219631000 -0400
@@ -1288,6 +1288,11 @@
continue
;;
+ -fuse-ld=*)
+ compiler_flags="$compiler_flags $qarg"
+ continue
+ ;;
+
-inst-prefix-dir)
prev=inst_prefix
continue