pqwy / cpuid

Detect CPU features
ISC License
10 stars 1 forks source link

Installation fails on Debian stretch/testing due to PIC #2

Closed verbosemode closed 7 years ago

verbosemode commented 7 years ago

I've already tried to fix it in a local pin by adding -fPIC to the _tags file and then by setting "export CFLAGS=-fPIC", but without success. However, this was just a try, since I don't have any deeper knowledge about the build process or ocamlbuild yet :-)

Just let me know if you need more details about my setup.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux testing (stretch)
Release:    testing
Codename:   stretch
$ uname -a
Linux k0ld 4.7.0-1-amd64 #1 SMP Debian 4.7.8-1 (2016-10-19) x86_64 GNU/Linux

~/.opam/4.03.0/build/cpuid.dev~mirage/cpuid-20385-af57d6.out

ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package ocb-stubblr myocamlbuild.ml /home/lobo/.opam/4.03.0/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
+ ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package ocb-stubblr myocamlbuild.ml /home/lobo/.opam/4.03.0/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(startup_aux.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(fail.o): relocation R_X86_64_32 against symbol `caml_exn_Failure' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(roots.o): relocation R_X86_64_32 against symbol `caml_frametable' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(globroots.o): relocation R_X86_64_32 against symbol `caml_global_roots' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(signals.o): relocation R_X86_64_32S against undefined symbol `caml_pending_signals' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(signals_asm.o): relocation R_X86_64_32S against symbol `caml_system__code_end' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(freelist.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(misc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(major_gc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(minor_gc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(memory.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(alloc.o): relocation R_X86_64_32S against undefined symbol `caml_atom_table' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(compare.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(ints.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(floats.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(str.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(array.o): relocation R_X86_64_32 against undefined symbol `caml_atom_table' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(io.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(extern.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(intern.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(hash.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(sys.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(parsing.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(gc_ctrl.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(obj.o): relocation R_X86_64_32S against undefined symbol `caml_atom_table' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(lexing.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(printexc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(callback.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(weak.o): relocation R_X86_64_32 against symbol `caml_ephe_ref_table' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(compact.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(finalise.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(custom.o): relocation R_X86_64_32 against symbol `caml_custom_table' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(unix.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(backtrace.o): relocation R_X86_64_32 against symbol `caml_backtrace_last_exn' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/lobo/.opam/4.03.0/lib/ocaml/libasmrun.a(startup.o): relocation R_X86_64_32S against symbol `caml_data_segments' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
Command exited with code 2.

~/.opam/4.03.0/build/cpuid.dev~mirage/cpuid-20385-af57d6.err

pkg.ml: [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-tag' 'debug'
     '-build-dir' '_build' '-plugin-tag' 'package(ocb-stubblr)' 'opam'
     'pkg/META' 'CHANGES.md' 'LICENSE.md' 'README.md' 'src/cpuid.a'
     'src/cpuid.cmxs' 'src/cpuid.cmxa' 'src/cpuid.cma' 'src/cpuid.cmx'
     'src/cpuid.cmi' 'src/cpuid.mli' 'src/dllcpuid_stubs.so'
     'src/libcpuid_stubs.a']: exited with 10

_tags

true: color(always)
true: bin_annot, safe_string
true: warn(A-4-29-33-40-41-42-43-34-44-48)
true: bin_annot, safe_string, package(bytes), package(result)

<src>: include
<src/*.cm{,x}a>: link_stubs(src/libcpuid_stubs)
<src/native/*.c>: ccopt(--std=c99 -Wall -Wextra -O3 -fPIC)

<test>: include
<test/*>: use_cpuid
verbosemode commented 7 years ago

Sorry for bothering.you. My Opam switch was broken somehow. It works without any issues on a fresh 4.03.0 switch.