Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Fresh system - almost evry emerge fails.
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
cyganosw
n00b
n00b


Joined: 20 Apr 2017
Posts: 14

PostPosted: Thu Apr 20, 2017 9:45 pm    Post subject: Fresh system - almost evry emerge fails. Reply with quote

Hi. After few years i decided to install Gentoo again. Maybe first is good to describe problem. I did everything with instructions, partitioning then stage, emerge --sync and i'm now in the moment when you have to do emerge @world like --newuse and others. First thing what was problematic for me when i did -pv options it showed me a lot of collisions because of perl so i thought there is a problem. i was searching all the time but i didn't even know there was problem not laying there because i skipped the collisions and when emerge was runing it was failing evry time on perl package so i thought it was because of the dependencies. I tried it for miscellanous settings and nothing. But then i realized that maybe it fails because of the gcc so i decided to recompile gcc(the idea was from this i saw on perl wiki something said about bootstrap so the bulb blinked). But gcc compilation also failed then i tried binutils and glibc and also same fault. it's not written anything exact there why it failed generally it looks like this: (example)

Code:


...

rm -f libgold.a
x86_64-pc-linux-gnu-ar cru libgold.a archive.o attributes.o binary.o common.o compressed_output.o copy-relocs.o cref.o defstd.o descriptors.o dirsearch.o dynobj.o dwarf_reader.o ehframe.o errors.o expression.o fileread.o gc.o gdb-index.o gold.o gold-threads.o icf.o incremental.o int_encoding.o layout.o mapfile.o merge.o nacl.o object.o options.o output.o parameters.o plugin.o readsyms.o reduced_debug_output.o reloc.o resolve.o script-sections.o script.o stringpool.o symtab.o target.o target-select.o timer.o version.o workqueue.o workqueue-threads.o  yyscript.o 
x86_64-pc-linux-gnu-ranlib libgold.a
x86_64-pc-linux-gnu-g++ -W -Wall    -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=dwp  -march=broadwell -O2 -pipe  -Wl,-O1 -Wl,--as-needed -o dwp dwp.o libgold.a ../libiberty/libiberty.a   -lpthread -ldl -lz -ldl
mv -f .deps/mips.Tpo .deps/mips.Po
x86_64-pc-linux-gnu-g++ -W -Wall    -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=ld-new  -march=broadwell -O2 -pipe  -Wl,-O1 -Wl,--as-needed -o ld-new main.o i386.o x86_64.o sparc.o powerpc.o arm.o arm-reloc-property.o tilegx.o mips.o aarch64.o aarch64-reloc-property.o s390.o libgold.a ../libiberty/libiberty.a   -lpthread -ldl -lz -ldl
x86_64-pc-linux-gnu-g++ -W -Wall    -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=incremental-dump  -march=broadwell -O2 -pipe  -Wl,-O1 -Wl,--as-needed -o incremental-dump incremental-dump.o i386.o x86_64.o sparc.o powerpc.o arm.o arm-reloc-property.o tilegx.o mips.o aarch64.o aarch64-reloc-property.o s390.o libgold.a ../libiberty/libiberty.a  -lpthread -ldl -lz -ldl
make[4]: Leaving directory '/var/tmp/portage/sys-devel/binutils-2.26.1/work/build/gold'
make[3]: Leaving directory '/var/tmp/portage/sys-devel/binutils-2.26.1/work/build/gold'
make[2]: Leaving directory '/var/tmp/portage/sys-devel/binutils-2.26.1/work/build/gold'
make[1]: Leaving directory '/var/tmp/portage/sys-devel/binutils-2.26.1/work/build'
make: *** [Makefile:846: all] Error 2
 * ERROR: sys-devel/binutils-2.26.1::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-devel/binutils-2.26.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/binutils-2.26.1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-devel/binutils-2.26.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/binutils-2.26.1/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-devel/binutils-2.26.1/work/build'
 * S: '/var/tmp/portage/sys-devel/binutils-2.26.1/work/binutils-2.26.1'

>>> Failed to emerge sys-devel/binutils-2.26.1, Log file:

>>>  '/var/tmp/portage/sys-devel/binutils-2.26.1/temp/build.log'

 * Messages for package sys-devel/binutils-2.26.1:

 * ERROR: sys-devel/binutils-2.26.1::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-devel/binutils-2.26.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/binutils-2.26.1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-devel/binutils-2.26.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/binutils-2.26.1/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-devel/binutils-2.26.1/work/build'
 * S: '/var/tmp/portage/sys-devel/binutils-2.26.1/work/binutils-2.26.1'



and every of that packages fails like this. but some little packages compiles normal only the system ones that important ones fails. then i realized that maybe the make.conf it's done wrong and the compilator gets wrong instructions(or something like this i'm an amateur). it looks like this:

Code:

# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.

CFLAGS="-march=broadwell -O2 -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j3"

# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.

CHOST="x86_64-pc-linux-gnu"

# These are the USE and USE_EXPAND flags that were used for
# buidling in addition to what is provided by the profile.

USE="perl bindist"

CPU_FLAGS_X86="aes avx fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"

PORTDIR="/usr/portage"
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"

GENTOO_MIRRORS="rsync://mirror.leaseweb.com/gentoo/ ftp://mirror.leaseweb.com/gentoo/ http://mirror.leaseweb.com/gentoo/ rsync://ftp.snt.utwente.nl/gentoo ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://gentoo.prz.rzeszow.pl rsync://gentoo.prz.rzeszow.pl/gentoo rsync://ftp.vectranet.pl/gentoo/ ftp://ftp.vectranet.pl/gentoo/ http://ftp.vectranet.pl/gentoo/"


i wasn't sure about the -march options. i searched a lot to write it but still didn't find anything clear. could you maybe check if it's good chosen? the processor is Intel Pentium 3825U. it said some command it's model 61 but on official CFLAGS how-to there is no such model. Please give some advice because i'm fighting with that 2nd day and don't know what to do. If needed more info then i will past i'm just extra tired today and my english and concentration are very low level so sorry for not everywhere clear post :) I have hope you'll forgive.


EDIT:

I've set -march=native and binutils compiled so probably this was the reason. but how should i set it proper? now i have set mtune=native but i don't know what exactly i' doing.

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2574

PostPosted: Thu Apr 20, 2017 11:03 pm    Post subject: Reply with quote

Welcome to Gentoo!

The perl thing is just happening right now. It isn't your fault and it isn't typical. emerge --nodeps perl should fix it. This is not recommended normal procedure, just a specific fix. --nodeps is a recipe for disaster if you don't know what you are doing.

CFLAGS="-march=broadwell -O2 -pipe" would be best as CFLAGS="-march=native -O2 -pipe" It sounds like you don't actually have a broadwell cpu and google agrees. mtune=native should be completely unneeded.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
dpaddy
Tux's lil' helper
Tux's lil' helper


Joined: 25 Jun 2008
Posts: 117

PostPosted: Thu Apr 20, 2017 11:13 pm    Post subject: Reply with quote

May not be related, but I recently had similar problems with perl collisions...
Happily, there were also problems with portage... I did the following

1) emerge -C virtual/perl-File-Temp
2) got package.use right for portage (sys-apps/portage python_targets_python3_4)
3) got package.use right for python (dev-lang/python ssl threads)

Then emerge @world worked; the perl collisions magically went away.
emerge finished but complained about python, so I added the xml flag and emerged python again.
System is happy now.

I can't pretend to know what's going on... Good luck :wink:
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 837

PostPosted: Thu Apr 20, 2017 11:47 pm    Post subject: Reply with quote

Another tip: Eliminate "bindist" from your USE flags, unless you are compiling programs for further distribution.
Back to top
View user's profile Send private message
cyganosw
n00b
n00b


Joined: 20 Apr 2017
Posts: 14

PostPosted: Sat Apr 22, 2017 9:30 am    Post subject: Reply with quote

ok now situation is quite clear for me. i checked and with -march=native it compiles fine. i quickly last time read somewhere the -mtune option is for this when you dont know what arch do you have and you want compiller to use CPU FLAGS instead of CFLAGS. I mean here things like mmx sse and other because list of them i could find for my processor.

Only sad thing is for me i was so much telling my girlfriend about gentoo "you will see everything what is compiled is building straight for your computer and no unneeded things" and now when using native march flag i feel like i install some standard random amd64 distribution. I understand problem with finding proper architecture because computer which i bought it was some brand from Media Markt called PEAQ but i was so stupid buying this laptop instead of some trusted company(example: didn't even passed first dissasemblation because one bolt didn't want to unscrew it was spinning in one position all the time so thats generallly effects of china product and RAM 2GB is made in korea or japan i dont remember but 4GB to be cheaper is made in china). Label says it's 5th generation processor and its 14nm technology but haswell when i read it was like 4th generation and 22nm technology but i thought it will be most similar type. Is there an option to adjust march option proper? Or even if i use march native option wouldn't be same as already prepared amd64 package binary? this is what i'm most scared because i decided to install gentoo because now i have quiite fast computer so i wanted to see how really fast it can be.

EDIT:

Now i see i have written about haswell but in make.conf is written broadwell its because should be broadwell but on page where i was looking for knoweledge was nowhere broadwell so i decided to use haswell as most similar but compilation i tried on both and both failed but here i put lspci which says it's broadwell:

Code:

00:00.0 Host bridge: Intel Corporation Broadwell-U Host Bridge -OPI (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Broadwell-U Integrated Graphics (rev 09)
00:03.0 Audio device: Intel Corporation Broadwell-U Audio Controller (rev 09)
00:14.0 USB controller: Intel Corporation Wildcat Point-LP USB xHCI Controller (rev 03)
00:16.0 Communication controller: Intel Corporation Wildcat Point-LP MEI Controller #1 (rev 03)
00:1b.0 Audio device: Intel Corporation Wildcat Point-LP High Definition Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #1 (rev e3)
00:1c.2 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #3 (rev e3)
00:1c.3 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #4 (rev e3)
00:1f.0 ISA bridge: Intel Corporation Wildcat Point-LP LPC Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation Wildcat Point-LP SATA Controller [AHCI Mode] (rev 03)
00:1f.3 SMBus: Intel Corporation Wildcat Point-LP SMBus Controller (rev 03)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
03:00.0 Network controller: Intel Corporation Wireless 3160 (rev 83)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43207
Location: 56N 3W

PostPosted: Sat Apr 22, 2017 11:10 am    Post subject: Reply with quote

cyganosw,

-march=native tells gcc to use the the flags for the CPU its actually running on.

You can see the settings with
Code:
gcc -### -E - -march=native 2>&1 | sed -r '/cc1/!d;s/(")|(^.* - )|( -mno-[^\ ]+)//g'
I get
Code:
-march=amdfam10 -mmmx -m3dnow -msse -msse2 -msse3 -msse4a -mcx16 -msahf -mpopcnt -mabm -mlzcnt -mprfchw -mfxsr --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=amdfam10

-march forces -mtune. In my example, to amdfam10.

You set -march and -mtune explicitly and separately when yon need to run the code on several different CPUs - choose a common -march that will run on them all, and set -mtune to favour one. This optimises the instruction ordering in favour on one CPU.

-march=native cannot be used by binary distros an they would need to produce different install media and keep different repositories for all the different CPUs.
That's not practical. They build to the lowest common denominator. So their 64 bit offerings run on any 64 bit CPU.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10306
Location: Córdoba (Spain)

PostPosted: Sat Apr 22, 2017 11:54 am    Post subject: Reply with quote

cyganosw wrote:
ok now situation is quite clear for me. i checked and with -march=native it compiles fine. i quickly last time read somewhere the -mtune option is for this when you dont know what arch do you have and you want compiller to use CPU FLAGS instead of CFLAGS. I mean here things like mmx sse and other because list of them i could find for my processor.


A simple

Code:
$ cat /proc/cpuinfo


Will show you what cpu you have. After that, just google or use the wikipedia and you will find soon enough what architecture you should be using. You can also use this Gentoo doc:

https://wiki.gentoo.org/wiki/Safe_CFLAGS

Anyway, unless you are using the absolutely latest cpu, -march=native will be the best you can get.

Quote:
Only sad thing is for me i was so much telling my girlfriend about gentoo "you will see everything what is compiled is building straight for your computer and no unneeded things" and now when using native march flag i feel like i install some standard random amd64 distribution.


No. "native" means "let gcc guess my cpu, and use whatever is best for it. And it's the absolute best, unless your cpu is so new that it is not supported, or unless you plan to reutilize your binaries in more than one system (in which case, you should use the lower common denominator of them all.

Quote:
I understand problem with finding proper architecture because computer which i bought it was some brand from Media Markt called PEAQ but i was so stupid buying this laptop instead of some trusted company(example: didn't even passed first dissasemblation because one bolt didn't want to unscrew it was spinning in one position all the time so thats generallly effects of china product and RAM 2GB is made in korea or japan i dont remember but 4GB to be cheaper is made in china). Label says it's 5th generation processor and its 14nm technology but haswell when i read it was like 4th generation and 22nm technology but i thought it will be most similar type. Is there an option to adjust march option proper? Or even if i use march native option wouldn't be same as already prepared amd64 package binary? this is what i'm most scared because i decided to install gentoo because now i have quiite fast computer so i wanted to see how really fast it can be.


Buying any laptop in media markt is never a good idea, but not for the reason you said. I already gave you the procedure to find your cpu above. Use /proc/cpuinfo
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
cyganosw
n00b
n00b


Joined: 20 Apr 2017
Posts: 14

PostPosted: Sat Apr 22, 2017 12:19 pm    Post subject: Reply with quote

Hi. Now you made me much more happy i thought native is more like "same for all in doubt" but it's good i was wrong :) I have also one question, because i had Gentoo earlier but it was times when everybody had 1 processor only(except very rich people etc. btw i'm from Poland and technology also was little bit slow going) and was migration from kernel 2.4 to 2.6. And then everything was much more clear for me. And because my mind is so oldtime now i don't get it how it works when you have more cores or threads just don't know what it is. Main problem for me is interpretation, if i have 2 cores and 4 threads i should interpret it under linux always as 4 procs? Like makeopts should be for me -j3 or -j5?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43207
Location: 56N 3W

PostPosted: Sat Apr 22, 2017 1:44 pm    Post subject: Reply with quote

cyganosw,

Its not that easy any more. The simple answer to CPU cores with multiple threads is "sometimes".
It varies by workload.

Try threads+1 and see what happens. If your system starts swapping back it off.
Allow each instance of gcc 512MB RAM. With four physical cores and eight threads, expect gcc to use 4G RAM.
If you don't have at least 4G RAM, set MAKEOPTS lower.

Start at threads+1 and watch the CPU load and RAM use.
Unfortunately, higher CPU load and more RAM use does not automatically mean reduced compile times.
Swapping will slow things down considerably.
CPU 'cache thrashing' when the working set for more compile jobs no longer fits the CPU cache slows things down too.
Things that you would like to keep in cache have to be refetched from much slower main memory because they were displaced by another process.

-- edit --
There is a catch to -march=native. gcc needs to understand your CPU.
If you have a Ryzen CPU, that needs gcc-6.3. Older gcc versions do not have -march=rzver1. I don't know what gcc does when you give -march=native and it does not understand the CPU its running on.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.


Last edited by NeddySeagoon on Sat Apr 22, 2017 1:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
cyganosw
n00b
n00b


Joined: 20 Apr 2017
Posts: 14

PostPosted: Sat Apr 22, 2017 1:48 pm    Post subject: Reply with quote

fresh news maybe it's good news for much people: today i formatted back to empty my root partition and started again from installing stage3 and i saw there is perl-5.24 already at stage3 so there is no need to update it anymore :)
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