LD /home/mike/jailhouse/jailhouse/tools/jailhouse
/usr/bin/ld: /home/mike/jailhouse/jailhouse/tools/jailhouse.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: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
/home/mike/jailhouse/jailhouse/tools/Makefile:60: recipe for target '/home/mike/jailhouse/jailhouse/tools/jailhouse' failed
make[3]: *** [/home/mike/jailhouse/jailhouse/tools/jailhouse] Error 1
scripts/Makefile.build:567: recipe for target '/home/mike/jailhouse/jailhouse/tools' failed
make[2]: *** [/home/mike/jailhouse/jailhouse/tools] Error 2
Makefile:1524: recipe for target '_module_/home/mike/jailhouse/jailhouse' failed
make[1]: *** [_module_/home/mike/jailhouse/jailhouse] Error 2
Makefile:36: recipe for target 'modules' failed
make: *** [modules] Error 2
Any suggestions how to solve this error?
Thanks,
mike
make "CC=gcc-6"
gives the same error.
My installed compiler version is
mike@ubuntu1704ssd:~/jailhouse/jailhouse$ gcc --version
gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
I also tried to build the tagged versions v0.7 and v0.6 and I'm getting the same error. So I think it's a problem with my local configuration/installation.
Any other advise?
Regards,
mike
On Tuesday, June 20, 2017 at 12:42:44 PM UTC+2, Henning Schild wrote:
> Am Tue, 20 Jun 2017 02:59:02 -0700
> schrieb mike:
mike@ubuntu1704ssd:~/jailhouse/jailhouse$ sudo apt-get install gcc-5
mike@ubuntu1704ssd:~/jailhouse/jailhouse$ make CC=gcc-5
LD /home/mike/jailhouse/jailhouse/tools/jailhouse
/usr/bin/ld: /home/mike/jailhouse/jailhouse/tools/jailhouse.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: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
/home/mike/jailhouse/jailhouse/tools/Makefile:60: recipe for target '/home/mike/jailhouse/jailhouse/tools/jailhouse' failed
make[3]: *** [/home/mike/jailhouse/jailhouse/tools/jailhouse] Error 1
scripts/Makefile.build:567: recipe for target '/home/mike/jailhouse/jailhouse/tools' failed
make[2]: *** [/home/mike/jailhouse/jailhouse/tools] Error 2
Makefile:1524: recipe for target '_module_/home/mike/jailhouse/jailhouse' failed
make[1]: *** [_module_/home/mike/jailhouse/jailhouse] Error 2
Makefile:36: recipe for target 'modules' failed
make: *** [modules] Error 2
My system is an intel core-i7 processor:
mike@ubuntu1704ssd:~/jailhouse/jailhouse$ uname -a
Linux ubuntu1704ssd 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
mike@ubuntu1704ssd:~/jailhouse/jailhouse$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 30
Model name: Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz
Stepping: 5
CPU MHz: 2000.000
CPU max MHz: 2800,0000
CPU min MHz: 1200,0000
BogoMIPS: 5617.26
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
NUMA node0 CPU(s): 0-7
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid dtherm ida
Regards,
mike
Adding -fPIC to tools/Makefile
KBUILD_CFLAGS := -fPIC -g -O3 -DLIBEXECDIR=\"$(libexecdir)\" \
-Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
-DJAILHOUSE_VERSION=\"$(shell cat $(src)/../VERSION)\" $(EXTRA_CFLAGS)
did the job.
Regards,
mike
Thank your guys, I have solved the same problem with the same measure...
ERROR obtained :
g++ -shared -fPIC -o Build/libNSCGBI.so dllmain.o NSCGBI.o
/usr/bin/ld: NSCGBI.o: relocation R_X86_64_32 against `.rodata' 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
Can any one help me regarding this ??