[MacPorts] #56932: at-spi2-core @2.28.0 fails to build on Mac OS X 10.4.11 due to issues with -rpath in meson
MacPorts
noreply at macports.org
Sat Dec 29 12:13:19 UTC 2018
#56932: at-spi2-core @2.28.0 fails to build on Mac OS X 10.4.11 due to issues with
-rpath in meson
---------------------------+--------------------
Reporter: ballapete | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Resolution: | Keywords: tiger
Port: at-spi2-core |
---------------------------+--------------------
Comment (by ballapete):
I don't know how to integrate the additional patch step for Tiger, but I
can describe how it works with **ed** – I think this is most reliable.
My algorithm is this:
· search forward for the characteristic string argument `'-Wl,-rpath,'`
· search backward for the characteristic start of if clause `if
mesonlib.is_osx():` (or empty line and then go down one line with `+`?)
· mark the line found
· search forward for the first empty line (I think this tells the Python
interpreter the end of the if clause)
· now delete from the marked line until here all lines
· write back into the file the edited contents and quit
So the `ed` script looks simple like this:
{{{
/'-Wl,-rpath,'
?if mesonlib.is_osx():
ka
/^$
'a,.d
wq
}}}
It can be applied à la
{{{
ed compilers.py < compilers/compilers.ed
}}}
or ''inline'' à la
{{{
printf "/'-Wl,-rpath,'\n?if mesonlib.is_osx():\nka\n/^$\n'a,.d\nwq\n" | ed
compilers/compilers.py
}}}
Presumingly this is the preferred way…
diff shows this difference between original file and patched file:
{{{
@@ -1194,22 +1194,6 @@
# linked against local libraries will fail to resolve them.
args.append('-Wl,-z,origin')
- if mesonlib.is_osx():
- # macOS does not support colon-separated strings in LC_RPATH,
- # hence we have to pass each path component individually
- args += ['-Wl,-rpath,' + rp for rp in all_paths]
- else:
- # In order to avoid relinking for RPATH removal, the binary
needs to contain just
- # enough space in the ELF header to hold the final
installation RPATH.
- paths = ':'.join(all_paths)
- if len(paths) < len(install_rpath):
- padding = 'X' * (len(install_rpath) - len(paths))
- if not paths:
- paths = padding
- else:
- paths = paths + ':' + padding
- args.append('-Wl,-rpath,' + paths)
-
if get_compiler_is_linuxlike(self):
# Rpaths to use while linking must be absolute. These are not
# written to the binary. Needed only with GNU ld:
}}}
--
Ticket URL: <https://trac.macports.org/ticket/56932#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list