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

Add :standard to the stub flags #27

Conversation

Leonidas-from-XIV
Copy link

While running the CI tests for a PR in Yojson, I realized that bin_prot doesn't build on opensuse-15.5-5.2_opam-2.1 with the following error:

# /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: xen/blit_stubs.o: warning: relocation against `caml_leave_blocking_section' in read-only section `.text'
# /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: xen/blit_stubs.o: relocation R_X86_64_PC32 against symbol `memcpy@@GLIBC_2.14' can not be used when making a shared object; recompile with -fPIC
# /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: final link failed: bad value
# collect2: error: ld returned 1 exit status

This is most likely due to mirage-xen not existing thus flags being set to ()

Package mirage-xen was not found in the pkg-config search path.
Perhaps you should add the directory containing `mirage-xen.pc'
to the PKG_CONFIG_PATH environment variable
No package 'mirage-xen' found
File "xen/dune", line 8, characters 0-215:
 8 | (library
 9 |  (foreign_stubs
10 |   (language c)
11 |   (flags
12 |    (:include cflags.sexp)))
13 |  (name bin_prot_xen)
14 |  (public_name bin_prot.xen)
15 |  (optional)
16 |  (virtual_deps mirage-xen-ocaml)
17 |  (libraries)
18 |  (preprocess no_preprocessing))

This PR adds :standard flags to the build in any case.

This prevents issues with `-fPIC`

Signed-off-by: Marek Kubica <marek@tarides.com>
@aalekseyev
Copy link
Contributor

We'll remove this stuff instead as #29 suggests.

@aalekseyev aalekseyev closed this Jun 10, 2024
Leonidas-from-XIV added a commit to Leonidas-from-XIV/opam-repository that referenced this pull request Jun 27, 2024
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: xen/blit_stubs.o: warning: relocation against `caml_leave_blocking_section' in read-only section `.text'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: xen/blit_stubs.o: relocation R_X86_64_PC32 against symbol `memcpy@@GLIBC_2.14' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

Probably due to a missing -fPIC flag. Upstream fix submitted in
janestreet/bin_prot#27 and obsoleted by
janestreet/bin_prot#29.
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

Successfully merging this pull request may close these issues.

None yet

2 participants