Re: Compile error "recompile with -fPIC"

2018-08-10 Thread shilparavindra03
Hi,
Even am getting similar kind of error but the difference is am executing in 
CentOS 7.5. and am not able to find in which make file i need to add -fPIC 
option because tools/makefile is not present. 

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 ??

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Compile error "recompile with -fPIC"

2018-08-10 Thread shilparavindra03
On Tuesday, June 20, 2017 at 8:42:59 PM UTC+5:30, Henning Schild wrote:
> Am Tue, 20 Jun 2017 04:36:14 -0700
> schrieb mike :
> 
> > Henning,
> > i installed gcc-5 with the same results:
> > 
> > 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
> 
> I can reproduce it and am guessing that is somehow coming from a kernel
> config option or maybe a ubuntu patched toolchain. But you can probably
> just add the "-fPIC" and proceed. Edit tools/Makefile and add it to
> KBUILD_CFLAGS.
> 
> Henning
> 
> > 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,
> > CPU min MHz:   1200,
> > 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
> > 
> > > 
> > > Well because your default is 6 anyways, try 5 or 4.9 in that case. I
> > > will try to reproduce it. gcc-6.3 works on debian just fine. Just to
> > > make sure you are on x86_64?
> > > 
> > > Henning
> > >   
> > > > 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:
> > > > > 
> > > > > > To learn about jailhouse I'm trying to compile jailhouse on a
> > > > > > ubuntu 17.04 machine  and I'm getting the link error
> > > > > 
> > > > > Maybe try an older compiler, which version is your gcc? You can
> > > > > probably install something older and compile jailhouse with that
> > > > > i.e
> > > > > "make CC=gcc-6"
> > > > > 
> > > > > Henning
> > > >  
> >


Hi,
even am getting the same error but the difference is am executing in CentOS 
7.5. and am not able to find in which make file i need to add -fPIC option 
because tools/makefile is not present. can you help me regarding this?

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Compile error "recompile with -fPIC"

2017-06-23 Thread Henning Schild
Am Thu, 22 Jun 2017 20:20:35 -0700
schrieb :

> On Tuesday, June 20, 2017 at 11:49:42 AM UTC-4, mike wrote:
> > Henning,
> > thank you for the great support.
> > 
> > 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
> >   
> > > 
> > > I can reproduce it and am guessing that is somehow coming from a
> > > kernel config option or maybe a ubuntu patched toolchain. But you
> > > can probably just add the "-fPIC" and proceed. Edit
> > > tools/Makefile and add it to KBUILD_CFLAGS.
> > > 
> > > Henning
> > >  
> 
> Thank your guys, I have solved the same problem with the same
> measure...

You can revert that local change and "git am"
https://groups.google.com/forum/message/raw?msg=jailhouse-dev/qMoi1sjjyfk/6BhZVAxtAwAJ

Henning

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Compile error "recompile with -fPIC"

2017-06-22 Thread resurgenceoflife
On Tuesday, June 20, 2017 at 11:49:42 AM UTC-4, mike wrote:
> Henning,
> thank you for the great support.
> 
> 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
> 
> > 
> > I can reproduce it and am guessing that is somehow coming from a kernel
> > config option or maybe a ubuntu patched toolchain. But you can probably
> > just add the "-fPIC" and proceed. Edit tools/Makefile and add it to
> > KBUILD_CFLAGS.
> > 
> > Henning
> >

Thank your guys, I have solved the same problem with the same measure...

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Compile error "recompile with -fPIC"

2017-06-20 Thread mike
Henning,
thank you for the great support.

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

> 
> I can reproduce it and am guessing that is somehow coming from a kernel
> config option or maybe a ubuntu patched toolchain. But you can probably
> just add the "-fPIC" and proceed. Edit tools/Makefile and add it to
> KBUILD_CFLAGS.
> 
> Henning
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Compile error "recompile with -fPIC"

2017-06-20 Thread Henning Schild
Am Tue, 20 Jun 2017 03:54:10 -0700
schrieb mike :

> Henning, thanks for the hint.
> 
> 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

Well because your default is 6 anyways, try 5 or 4.9 in that case. I
will try to reproduce it. gcc-6.3 works on debian just fine. Just to
make sure you are on x86_64?

Henning

> 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:
> >   
> > > To learn about jailhouse I'm trying to compile jailhouse on a
> > > ubuntu 17.04 machine  and I'm getting the link error  
> > 
> > Maybe try an older compiler, which version is your gcc? You can
> > probably install something older and compile jailhouse with that
> > i.e
> > "make CC=gcc-6"
> > 
> > Henning  
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Compile error "recompile with -fPIC"

2017-06-20 Thread Henning Schild
Am Tue, 20 Jun 2017 02:59:02 -0700
schrieb mike :

> To learn about jailhouse I'm trying to compile jailhouse on a ubuntu
> 17.04 machine  and I'm getting the link error

Maybe try an older compiler, which version is your gcc? You can
probably install something older and compile jailhouse with that
i.e
"make CC=gcc-6"

Henning

>   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
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.