Skip to content
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

cross compile fail #3

Open
yry486555 opened this issue May 6, 2024 · 2 comments
Open

cross compile fail #3

yry486555 opened this issue May 6, 2024 · 2 comments

Comments

@yry486555
Copy link

Dear Sir,
I follow the build step to build for arm64 on x86 Linux machine.
When I executed cmake --build build-arm64 --config Release, it's failure as following log.
Have any suggestion for me? thanks

[100%] Linking CXX executable adb
ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against local symbol; recompile with -fPIC

defined in /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a(err.c.o)
referenced by err.c
err.c.o:(kLibraryNames) in archive /home/yan/adb_tool/adb/prebuilt/linux/aarch64/libcrypto.a

ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [src/CMakeFiles/adb.dir/build.make:606: src/adb] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:367: src/CMakeFiles/adb.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

@prife
Copy link
Owner

prife commented May 23, 2024

It seems the prebuilt libcrypto.a can't be link on your aarch64 linux. you have two ways:

  1. comiple libcrypto.a by https://github.com/prife/adb?tab=readme-ov-file#step2-build-boringssl
  2. use prebuilt arm64 binary adb, https://github.com/prife/adb/releases/tag/platform-tools-29.0.6

@yry486555
Copy link
Author

It seems the prebuilt libcrypto.a can't be link on your aarch64 linux. you have two ways:

  1. comiple libcrypto.a by https://github.com/prife/adb?tab=readme-ov-file#step2-build-boringssl
  2. use prebuilt arm64 binary adb, https://github.com/prife/adb/releases/tag/platform-tools-29.0.6

Dear Sir,
Thanks for your suggestions.
the item#1 you mentioned I have done it before runing cross-compile. So I don't know why it has this kind error. According to the error log, it says to recompile with -fPIC. Not sure how to do it.
If you have more suggestions, please kindly tell me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants