Niels Möller <ni...@lysator.liu.se> writes:

> Sam James <s...@gentoo.org> writes:
>
>> Note that Jannik identified the bad commit [0] as 18082:c5d0fcb06969 [4].
> [...]
>> [0] https://gmplib.org/list-archives/gmp-bugs/2020-December/004981.html
>> [1] https://gmplib.org/list-archives/gmp-bugs/2023-January/005223.html
>> [3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109765
>> [4] https://gmplib.org/repo/gmp/rev/c5d0fcb06969
>
> It looks like that commit changes
>
>   adrp        x1, approx_tab
>   add x1, x1, :lo12:approx_tab
>
> to
>
>   adrp        x1, :got:approx_tab
>   ldr x1, [x1, #:got_lo12:approx_tab]
>
> and only when PIC is defined (via LEA_HI and LEA_LO m4 macros). I
> haven't double checked what assembly files actually look like after
> preprocessing, though.
>
> And something similar for __gmp_binvert_limb_table.
>
> But I have no clue about the arm64 abi. Is PIC defined in the failing
> build, or should it be?

I think it is set.

If I try with explicit ./configure --with-pic to be sure, it still
fails.

If I try with explicit ./configure --without-pic, I can't build gmp:
```
[...]
/usr/lib/gcc/aarch64-unknown-linux-gnu/14/../../../../aarch64-unknown-linux-gnu/bin/ld:
mpn/.libs/bdiv_q_1.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against
symbol `__gmp_binvert_limb_table' which may bind externally can not be
used when making a shared object; recompile with -fPIC
mpn/.libs/bdiv_q_1.o: in function `__gmpn_bdiv_q_1':
```

with __gmp_binvert_limb_table being the symbol you and Jannik mentioned..

>
> Regards,
> /Niels

best,
sam

Attachment: signature.asc
Description: PGP signature

_______________________________________________
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs

Reply via email to