-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ld reports relocation error with -fPIC and -fno-integrated-as on MIPS64 #405
Labels
Comments
OK, I got a standalone test case. First create a file n32.S: .abicalls
.set mips4
.text
.align 2
.globl ffi_go_closure_N32
.ent ffi_go_closure_N32
ffi_go_closure_N32:
.LFB1:
.frame $sp, (20 * 8), $31
.mask 0x90000000,-((20 * 8) - (1 * 8))
.fmask 0x00000000,0
dsubu $sp, (20 * 8)
.LCFI10:
.cpsetup $25, (0 * 8), ffi_go_closure_N32
sd $31, (1 * 8)($sp) # Save return address
.LCFI11:
sd $4, (12 * 8)($sp)
sd $5, (13 * 8)($sp)
sd $6, (14 * 8)($sp)
sd $7, (15 * 8)($sp)
sd $8, (16 * 8)($sp)
sd $9, (17 * 8)($sp)
# Call ffi_closure_mips_inner_N32 to do the real work.
dla $25, ffi_closure_mips_inner_N32
ld $4, 8($15) # cif
ld $5, 16($15) # fun
move $6, $15 # userdata=$10
daddu $7, $sp, (2 * 8) # rvalue
daddu $8, $sp, (12 * 8) # ar
daddu $9, $sp, (4 * 8) # fpr
b $do_closure
.LFE1:
.end ffi_go_closure_N32 And compile this file with:
On my machine the result is:
|
MIPS is deprecated as of r16. |
Good news. Maintaining MIPS/MIPS64 builds is a real headache. Seems https://android.googlesource.com/platform/ndk.git/+/f90c6865de087c9b0cfd948124871c4982d62283 should be cherry-picked to ndk-release-r16 branch too? |
Yep, already on it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I'm building cpython, which uses libffi for calling external C functions. On NDK r15 beta 2, building for MIPS64 with -fintegrated-as fails during linking
I indeed built libffi with -fPIC:
If I rebuild everything with -fno-integrated-as, linking is fine.
Complete log can be fetched from https://travis-ci.org/yan12125/python3-android/jobs/233650249. I haven't had time to create a standalone test case. If you need one, please tell me.
The offending symbol reference can be found in https://github.com/libffi/libffi/blob/master/src/mips/n32.S, line 451 and line 485.
I'm not sure whether it's a regression after the clang update or not. I didn't use -fno-integrated-as or -fintegrated-as for MIPS64 before #399 hit me.
Environment Details
Not all of these will be relevant to every bug, but please provide as much
information as you can.
The text was updated successfully, but these errors were encountered: