On Sun, Feb 25, 2024 at 08:41:38PM +0100, Antonio T. sagitter wrote:
> libdv is currently failing in i686 architectures, it could be dropped.

Ugh, why?
The bug is not from upstream, but from the downstream libdv-pic.patch
patch, and is on i686 only because those changes are in i686 specific code.
Normally one wouldn't introduce these extra pointer arguments but instead
just use proper PIC accesses to the symbol, e.g. you could compile
extern unsigned char dv_quant_shifts[22][4];
int foo (void) { return dv_quant_shifts[0][0]; }
with -O2 -m32 -march=i686 -fpic -S and see what is needed.
Anyway, if it is done the way the patch does that, the assembly doesn't
care that much what exact pointer it gets as long as it points to the
dv_quant_shifts array.
So one fix is change the
+extern void _dv_quant_88_inverse_x86(dv_coeff_t *block,int qno,int klass, 
uint8_t *offset, uint8_t *shifts);
line in the patch to
+extern void _dv_quant_88_inverse_x86(dv_coeff_t *block,int qno,int klass, 
uint8_t *offset, uint8_t (*shifts)[4]);
and yet another would be to change
+      
_dv_quant_88_inverse_x86(mb->b[i].coeffs,mb->qno,mb->b[i].class_no,dv_quant_offset,dv_quant_shifts);
and
+       
_dv_quant_88_inverse_x86(bl->coeffs,mb->qno,bl->class_no,dv_quant_offset,dv_quant_shifts);
lines in the patch to
+      
_dv_quant_88_inverse_x86(mb->b[i].coeffs,mb->qno,mb->b[i].class_no,dv_quant_offset,(uint8_t
 *)dv_quant_shifts);
and
+       
_dv_quant_88_inverse_x86(bl->coeffs,mb->qno,bl->class_no,dv_quant_offset,(uint8_t
 *)dv_quant_shifts);
Fixing this is less work than dropping it from one arch and dealing with the
fallout.

        Jakub
--
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to