When trying to cross-compile tor for AARCH64 following error is given:
src/common/libor-crypto-testing.a(src_common_libor_crypto_testing_a-crypto_format.o): In function crypto_write_tagged_contents_to_file': crypto_format.c:(.text+0x1c): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol smartlist_new' defined in .text section in src/common/libor.a(container.o)
collect2: error: ld returned 1 exit status
The error might be misleading, I was told that this can happen because test and non-test library archives are getting mixed up and the aarch64 toolchain is more picky about this then other toolchains.
Trac: Username: wbx
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related.
Learn more.
I was able to reproduce the issue by configuring with CFLAGS="-O2 -flto". The attached patch fixed the issue for me. @wbx can you verify this?
As mentioned in the commit message, removing the non-testing library from the test binary dependencies caused undefined reference errors which were caused by missing dependencies. I have added the dependencies that the compiler complained about but i am not 100% sure i got them all because of the optional external dependencies that tor has. For instance, during testing i had to add sandbox.c for one machine because it had sandboxing capabilities while another machine did not (yay for conditional compilation).
Lifting all the other stuff into libor-crypto.a is not really a great idea; those libraries are truly supposed to be separate.
I think that the problem that dgoulet tried to fix in 2dc5d790d314beb202dfa1659161113f1f6dabf1 can be resolved better by making sure that libor-testing.a appears after libor-crypto-testing.a, which depends on it. I'm going to try that fix. If it doesn't work, then probably the right move is to take the dependencies in libor-testing.a and move them into a third library that both libcrypto-testing.a and libor-testing.a.
Possible fix committed as 82df3e70ac191a2a3cabf3574839e7561e00e370. Let's see if the builders like it. Let's close this ticket if it solves everybody's problems, and not otherwise.
Possible fix committed as 82df3e70ac191a2a3cabf3574839e7561e00e370. Let's see if the builders like it. Let's close this ticket if it solves everybody's problems, and not otherwise.
This solved the errors that i reproduced and is a lot cleaner than the patch i submitted. Thanks for that.
After looking into the Tor related commits made at Buildroot, i noticed they have now disabled unit tests (see [https://git.busybox.net/buildroot/commit/?id=41a14f3e394f46bd098daf4a76283315e3ae452a]) to (probably?) work around the issues in this ticket. For this reason, i am in favor of backporting the change to 0.2.7 so Buildroot can revert their change and run the unit tests again.
Since this is a build break it seems reasonable to consider for backport, and since it only affects the test suite it seems safe. Cherry-picked 82df3e70ac191a2a3cabf3574839e7561e00e370 to maint-0.2.7 and closing this.
Trac: Resolution: N/Ato fixed Status: needs_revision to closed