Tuesday, January 31, 2023

Re: NEW sysutils/borgbackup-2.0.0b4

On Tue, Jan 31, 2023 at 05:30:28AM +0100, Bjorn Ketelaars wrote:
> On Mon 30/01/2023 22:03, Stuart Henderson wrote:
> > On 2023/01/25 14:25, Bjorn Ketelaars wrote:
> > > Upstream of borgbackup is slowly moving towards 2.0.0, which will be a
> > > major breaking release that is not compatible with existing repos.
> > > Additionally, some borg 1.x commands that supported working on a repo
> > > AND on an archive have been split into 2 commands, some others were
> > > renamed. (Breaking) changes are detailed in
> > > https://borgbackup.readthedocs.io/en/2.0.0b4/changes.html#version-2-0-0b4-2022-11-27.
> > >
> > > Another change is that this new release will use EVP_aes_256_ocb, which
> > > is not provided by LibreSSL. As such, OpenSSL is used, which is linked
> > > statically to avoid conflicting with shared libcrypto from the base OS
> > > pulled in via dependencies.
> >
> > This fails on i386. It can be built with "MAKE_ENV = LDFLAGS=-Wl,-znotext";
> > I offer no opinion on how bad an idea that is, but we did already use it for
> > various other ports, mostly which have asm that uses a large number of registers.
> >
> > Full log below, here's the interesting bit:
>
> I do not have another solution for i386.
>
> Diff below OK? (no bump needed).

It has a typo. It should be -znotext rather than -znotex.

: cc -shared -fPIC -L/usr/local/lib/ -O2 -pipe build/temp.openbsd-7.2-i386-cpython-310/src/borg/crypto/low_level.o /usr/local/lib/eopenssl11/libcrypto.a -L/usr/local/lib -o build/lib.openbsd-7.2-i386-cpython-310/borg/crypto/low_level.cpython-310.so
: ld.lld: error: relocation R_386_PC32 cannot be used against symbol OPENSSL_ia32cap_P; recompile with -fPIC
: >>> defined in /usr/local/lib/eopenssl11/libcrypto.a(cryptlib.o)
: >>> referenced by rc4-586.s
: >>> rc4-586.o:(RC4_set_key) in archive /usr/local/lib/eopenssl11/libcrypto.a

If I'm not mistaken, the linker errors are coming from perlasm lines like:

&picmeup($idx,"OPENSSL_ia32cap_P");

Base libcrypto perlasm has long had some special openbsd handling in
::picmeup (perlasm/x86gas.pl and other bits in perlasm/*). Perhaps
something like this could be needed in security/openssl as well.

Unfortunately, I have not managed to make this work. Perhaps someone
more familiar with these chicken scratches and linkers could? If at all
possible it would be nice to address the root cause here rather than
adding more -znotext for i386.

No comments:

Post a Comment