Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] binhost: compiling gcc in chroot environment
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
mimosinnet
Guru
Guru


Joined: 10 Aug 2006
Posts: 521
Location: Barcelona, Spain

PostPosted: Thu Apr 24, 2014 11:55 am    Post subject: [SOLVED] binhost: compiling gcc in chroot environment Reply with quote

This is a hardened server to be used as a a binhost for laptops. The compilation is performed in a chroot environment. The host server is a:

Code:
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 8
model name      : AMD Opteron(tm) Processor 4180
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate npt lbrv svm_lock nrip_save pausefilter


The laptops:

Code:
vendor_id   : GenuineIntel
cpu family   : 6
model      : 37
model name   : Intel(R) Core(TM) i5 CPU       M 430  @ 2.27GHz
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 est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida arat dtherm tpr_shadow vnmi flexpriority ept vpid


When using this settings:

Code:
CFLAGS="-march=corei7 -O2 -pipe"


Emerges dies with this error:

Code:
checking for suffix of object files... configure: error: in `/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/x86_64-pc-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage2-target-libgcc] Error 1
make[2]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build'
make: *** [bootstrap-lean] Error 2
emake failed
 * ERROR: sys-devel/gcc-4.7.3-r1::gentoo failed (compile phase):
 *   emake failed with bootstrap-lean
 *
 * Call stack:
 *     ebuild.sh, line   93:  Called src_compile
 *   environment, line 3802:  Called toolchain_src_compile
 *   environment, line 4522:  Called gcc_do_make
 *   environment, line 1964:  Called die
 * The specific snippet of code:
 *       emake LDFLAGS="${LDFLAGS}" STAGE1_CFLAGS="${STAGE1_CFLAGS}" LIBPATH="${LIBPATH}" BOOT_CFLAGS="${BOOT_CFLAGS}" ${GCC_MAKE_TARGET} || die "emake failed with ${GCC_MAKE_TARGET}";


Nevertheless, it correctly emerges with:
Code:
CFLAGS="-march=core2 -O2 -pipe"


As the march value seems to be the key element affecting emerge's success, I am wondering what is affecting the compilation in the chroot environment. Any hints appreciated.

Thanks!
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved.
Thank the community answering other people's post, specially those unanswered.


Last edited by mimosinnet on Thu Apr 24, 2014 3:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 4148

PostPosted: Thu Apr 24, 2014 12:06 pm    Post subject: Reply with quote

gcc build gcc and use "that" gcc to build itself again.

So gcc build a gcc for i7 then use the i7-gcc to build the final gcc.
You can only build a gcc that is generic to both arch, using core2 your amd cpu seems able to run it, but using i7 it seems it cannot.

You can use a host to build for another host as long as the host only build the binary, if it need to run it, you must comply with the builder limitations.
Back to top
View user's profile Send private message
mimosinnet
Guru
Guru


Joined: 10 Aug 2006
Posts: 521
Location: Barcelona, Spain

PostPosted: Thu Apr 24, 2014 3:37 pm    Post subject: Reply with quote

Excellent! Thanks for the clarification! This means that the AMD binhost server can build a "general" X86-64 box but not a specific i7-intel box.
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved.
Thank the community answering other people's post, specially those unanswered.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum