All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Neuschäfer via buildroot" <buildroot@buildroot.org>
To: yann.morin@orange.com
Cc: "Bernd Kuhls" <bernd@kuhls.net>,
	"J. Neuschäfer" <j.neuschaefer@gmx.net>,
	"Yann E. MORIN" <yann.morin.1998@free.fr>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	buildroot@buildroot.org, "David du Colombier" <0intro@gmail.com>
Subject: Re: [Buildroot] [PATCH v5] Config.in: ban textrels on musl toolchains
Date: Sat, 24 Aug 2024 21:36:02 +0200	[thread overview]
Message-ID: <Zso2IgOZqYUyDE7W@probook> (raw)
In-Reply-To: <ZrsirnrvgsEIpAJI@tl-lnx-nyma7486-2>

On Tue, Aug 13, 2024 at 11:09:02AM +0200, yann.morin@orange.com wrote:
> J., All,
>
> +Bernd and +David for x264:
>
> On 2024-07-19 17:27 +0200, J. Neuschäfer via buildroot spake thusly:
> > This patch forbids the use of TEXTRELs on musl toolchains with dynamic
> > linking.
>
> Another build failure due to this change:
>
>     [...]/buildroot/output/per-package/x264/host/bin/../lib/gcc/i586-buildroot-linux-musl/12.4.0/../../../../i586-buildroot-linux-musl/bin/ld: common/x86/dct-a-8.o: warning: relocation in read-only section `.text'
>     [...]/buildroot/output/per-package/x264/host/bin/i586-buildroot-linux-musl-gcc-ranlib libx264.a
>     [...]/buildroot/output/per-package/x264/host/bin/../lib/gcc/i586-buildroot-linux-musl/12.4.0/../../../../i586-buildroot-linux-musl/bin/ld: read-only segment has dynamic relocations
>     collect2: error: ld returned 1 exit status
>     make[2]: *** [Makefile:251: libx264.so.164] Error 1
>     make[2]: *** Waiting for unfinished jobs....
>     make[1]: *** [package/pkg-generic.mk:289: [...]/buildroot/output/build/x264-baee400fa9ced6f5481a728138fed6e867b0ff7f/.stamp_built] Error 2
>     make: *** [Makefile:83: _all] Error 2
>
> There is still no failure in the autobuilders, as x264 is quite late
> in the alphabetical order, so it probably is just hidden by earlier
> failures...
>
> I have no idea what to look for to avoid those relocations in the first
> place, so could you have a look, please?
>
> Regards,
> Yann E. MORIN.

I took a look, the issue is that libx264's x86 assembly is position
dependent (patch coming in a separate email). For example:


SECTION .text

cextern pw_32
[...]

INIT_MMX mmx
cglobal add4x4_idct, 2,2
    pxor m7, m7
.skip_prologue:
    movq  m1, [r1+ 8]
    movq  m3, [r1+24]
    movq  m2, [r1+16]
    movq  m0, [r1+ 0]
    IDCT4_1D w,0,1,2,3,4,5
    TRANSPOSE4x4W 0,1,2,3,4
    paddw m0, [pw_32]           <--- here
    IDCT4_1D w,0,1,2,3,4,5
    STORE_DIFF  m0, m4, m7, [r0+0*FDEC_STRIDE]
    STORE_DIFF  m1, m4, m7, [r0+1*FDEC_STRIDE]
    STORE_DIFF  m2, m4, m7, [r0+2*FDEC_STRIDE]
    STORE_DIFF  m3, m4, m7, [r0+3*FDEC_STRIDE]
    RET


In my experience, hand-written assembly code is usually the culprit, but
of course not all hand-written assembly code has these issues.


-- jn
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      parent reply	other threads:[~2024-08-24 19:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-19 15:27 [Buildroot] [PATCH v5] Config.in: ban textrels on musl toolchains J. Neuschäfer via buildroot
2024-07-22 16:31 ` Thomas Petazzoni via buildroot
2024-07-30 22:03 ` Thomas Petazzoni via buildroot
2024-08-04 22:31   ` J. Neuschäfer via buildroot
2024-08-13  9:09 ` yann.morin
2024-08-23 10:21   ` J. Neuschäfer via buildroot
2024-08-24 19:36   ` J. Neuschäfer via buildroot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zso2IgOZqYUyDE7W@probook \
    --to=buildroot@buildroot.org \
    --cc=0intro@gmail.com \
    --cc=bernd@kuhls.net \
    --cc=j.neuschaefer@gmx.net \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    --cc=yann.morin@orange.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.