[vbox-dev] error: code model kernel does not support PIC mode
Sérgio Basto
sergio at serjux.com
Thu Sep 24 00:21:15 UTC 2015
Hi,
On Qua, 2015-09-23 at 18:14 +0100, Sérgio Basto wrote:
> Hi,
> I'm trying build VirtualBox-5.0.4 in Fedora 23 (Beta) , and I got this
> kind of errors :
>
> error: code model kernel does not support PIC mode
>
> I think F23 force hardened builds , so I added -fno-pic and this error
> passed but now I got a new error:
>
> g++ -shared -fPIC '-Wl,-rpath,/usr/lib64/virtualbox'
> -Wl,-z,noexecstack,-z,relro -Wl,--as-needed -m64
> -o /builddir/build/BUILD/VirtualBox-5.0.4/obj/obj/VBoxSVCM/VBoxSVCM.so
> -Wl,-soname=VBoxSVCM.so
> /builddir/build/BUILD/VirtualBox-5.0.4/obj/obj/VBoxSVCM/src-server/xpcom/server_module.o -lpthread -lm -lrt /builddir/build/BUILD/VirtualBox-5.0.4/obj/bin/VBoxRT.so -ldl /builddir/build/BUILD/VirtualBox-5.0.4/obj/lib/VBoxCOM.a
> /builddir/build/BUILD/VirtualBox-5.0.4/obj/bin/VBoxXPCOM.so
>
> /usr/bin/ld: /builddir/build/BUILD/VirtualBox-5.0.4/obj/obj/VBoxCAPI/VBoxCAPI.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
> /builddir/build/BUILD/VirtualBox-5.0.4/obj/obj/VBoxCAPI/VBoxCAPI.o:
> error adding symbols: Bad value
> /usr/bin/ld: /builddir/build/BUILD/VirtualBox-5.0.4/obj/obj/VBoxSVCM/src-server/xpcom/server_module.o: relocation R_X86_64_32 against `_ZZN11IVirtualBox6GetIIDEvE3iid' can not be used when making a shared object; recompile with -fPIC
> /builddir/build/BUILD/VirtualBox-5.0.4/obj/obj/VBoxSVCM/src-server/xpcom/server_module.o: error adding symbols: Bad value
>
>
> Can someone help me find out what is happening ?
I found the problem and was in set VBOX_GCC_OPT, VBOX_GCC_GC_OPT and
VBOX_GCC_R0_OPT with custom optimization flags , using defaults fix the
problem .
Sorry for the false alarm
> Thanks
--
Sérgio M. B.
More information about the vbox-dev
mailing list