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

Alr with fails: zlib/trees.o: relocation R_X86_64_PC32 against symbol `_length_code' #356

Open
TamaMcGlinn opened this issue Dec 25, 2022 · 0 comments

Comments

@TamaMcGlinn
Copy link

This same error occurs when you try to alr build a project that actually uses aws, but the repro steps are easier than that; just create a new project with Alire and add aws as a dependency and you get this error:

aws_21.0.0_57fddf8f/.build/x86_64-linux-gnu/release/relocatable/obj/zlib/trees.o: relocation R_X86_64_PC32 against symbol `_length_code' can not be used when making a shared object; recompile with -fPIC

Reproduction steps:

  • Create a new project alr init --bin hello_aws; cd hello_aws
  • Add aws alr with aws

You get this error:

/home/tama/.config/alire/cache/dependencies/gnat_native_11.2.4_2f37a10b/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/tama/code/ada/hello_aws/alire/cache/dependencies/aws_21.0.0_57fddf8f/.build/x86_64-linux-gnu/release/relocatable/obj/zlib/trees.o: warning: relocation against `_length_code' in read-only section `.text'
/home/tama/.config/alire/cache/dependencies/gnat_native_11.2.4_2f37a10b/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/tama/code/ada/hello_aws/alire/cache/dependencies/aws_21.0.0_57fddf8f/.build/x86_64-linux-gnu/release/relocatable/obj/zlib/trees.o: relocation R_X86_64_PC32 against symbol `_length_code' can not be used when making a shared object; recompile with -fPIC
/home/tama/.config/alire/cache/dependencies/gnat_native_11.2.4_2f37a10b/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
gprlib: /home/tama/.config/alire/cache/dependencies/gnat_native_11.2.4_2f37a10b/bin/gcc execution error
gprbuild: could not build library for project zlib
make: *** [Makefile:184: build-native] Error 4
error: A post-fetch action failed, re-run with -vv -d for details

Googling gives lots of results of solutions to this problem in other C libraries, and the solution is to add -fPIC to dependencies from the bottom up. I'm not sure how to do that for AWS.

TamaMcGlinn added a commit to TamaMcGlinn/AdaBots that referenced this issue Dec 29, 2022
Details here: AdaCore/aws#356

Evidently this was fixed in 23.0 because I can't reproduce this with
that version (which requires alr 1.2.1 and the corresponding community index)
TamaMcGlinn added a commit to TamaMcGlinn/alire-index that referenced this issue Jan 14, 2023
There was an error relating to relocatable symbols before, details here:
AdaCore/aws#356
TamaMcGlinn added a commit to TamaMcGlinn/alire-index that referenced this issue Jan 14, 2023
There was an error relating to relocatable symbols before, details here:
AdaCore/aws#356
mosteo pushed a commit to alire-project/alire-index that referenced this issue Jan 16, 2023
There was an error relating to relocatable symbols before, details here:
AdaCore/aws#356
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

1 participant