openbsd-ports/net/samba/patches/patch-buildtools_wafsamba_samba_autoconf_py
jca ce254b18ea Downgrade to samba-4.9.17
samba-4.10.10 and later fail to link on ld.bfd archs.  Revert until
someone(tm) tracks down the problem.

Errors look like:

/usr/bin/ld: BFD 2.17 internal error, aborting at
/usr/src/gnu/usr.bin/binutils-2.17/bfd/elfcode.h line 190 in void
bfd_elf64_swap_symbol_in(bfd *, const void *, const void *,
Elf_Internal_Sym *)

/usr/bin/ld:
/pobj/samba-4.10.10/samba-4.10.10/bin/default/lib/param/libserver-role-samba4.so:
invalid string offset 3755991007 >= 625 for section `.dynstr'

3755991007 is 0xDFDFDFDF is likely already freed memory.

build failures:
http://build-failures.rhaalovely.net/sparc64/2019-12-11/net/samba,.log
http://build-failures.rhaalovely.net/mips64/2019-12-06/net/samba,,-ldb.log
2019-12-19 02:57:28 +00:00

51 lines
1.9 KiB
Plaintext

$OpenBSD: patch-buildtools_wafsamba_samba_autoconf_py,v 1.12 2019/12/19 02:57:28 jca Exp $
1. Sort -L flags to unbreak linking when any other version of Samba is installed.
2. Use -Wl,-no-undefined as on other platforms.
Index: buildtools/wafsamba/samba_autoconf.py
--- buildtools/wafsamba/samba_autoconf.py.orig
+++ buildtools/wafsamba/samba_autoconf.py
@@ -848,6 +848,27 @@ def ADD_LDFLAGS(conf, flags, testflags=False):
if not 'EXTRA_LDFLAGS' in conf.env:
conf.env['EXTRA_LDFLAGS'] = []
conf.env['EXTRA_LDFLAGS'].extend(TO_LIST(flags))
+
+ ''' Make sure things go in order:
+ 1. Local -L and -rpath flags
+ 2. External -L and -rpath flags
+ 3. Others
+ '''
+ localL = []
+ extL = []
+ other = []
+ for f in conf.env['EXTRA_LDFLAGS']:
+ if f.startswith("-L%s" % "/usr/ports"):
+ localL.extend( [ f ] )
+ elif f.startswith("-L"):
+ extL.extend( [ f ] )
+ else:
+ other.extend( [ f ] )
+ conf.env['EXTRA_LDFLAGS'] = []
+ conf.env['EXTRA_LDFLAGS'].extend(localL)
+ conf.env['EXTRA_LDFLAGS'].extend(extL)
+ conf.env['EXTRA_LDFLAGS'].extend(other)
+
return flags
@@ -911,10 +932,9 @@ def SETUP_CONFIGURE_CACHE(conf, enable):
def SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS(conf):
# we don't want any libraries or modules to rely on runtime
# resolution of symbols
- if not sys.platform.startswith("openbsd"):
- conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
+ conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
- if not sys.platform.startswith("openbsd") and conf.env.undefined_ignore_ldflags == []:
+ if conf.env.undefined_ignore_ldflags == []:
if conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup']):
conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']