Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 588662 - ERROR: sys-devel/binutils-2.25.1-r1::gentoo failed (compile phase)
Summary: ERROR: sys-devel/binutils-2.25.1-r1::gentoo failed (compile phase)
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-12 08:46 UTC by Pál Csányi
Modified: 2016-07-13 16:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,469.60 KB, text/x-log)
2016-07-12 08:46 UTC, Pál Csányi
Details
emeerge -pqv (emerge-pqv,123 bytes, text/plain)
2016-07-12 08:46 UTC, Pál Csányi
Details
environment (environment,126.87 KB, text/plain)
2016-07-12 08:47 UTC, Pál Csányi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pál Csányi 2016-07-12 08:46:12 UTC
Created attachment 440420 [details]
build.log

Hi,
after eix-sync I try to update the system with the command:
emerge -aj --update --deep --with-bdeps=y --newuse @world

but get an ERROR message:
distcc[19842] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
{standard input}: Assembler messages:
{standard input}:42748: Warning: end of file not at end of a line; newline inserted
{standard input}:43113: Error: ']' expected -- `ldr r10,[r7,#16'
armv7a-hardfloat-linux-gnueabi-g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
distcc[19814] ERROR: compile /var/tmp/portage/sys-devel/binutils-2.25.1-r1/work/binutils-2.25.1/gold/powerpc.cc on localhost failed with exit code 4
Makefile:842: recipe for target 'powerpc.o' failed
make[4]: *** [powerpc.o] Error 4
make[4]: *** Waiting for unfinished jobs....
mv -f .deps/tilegx.Tpo .deps/tilegx.Po
mv -f .deps/arm.Tpo .deps/arm.Po
mv -f .deps/mips.Tpo .deps/mips.Po
make[4]: Leaving directory '/var/tmp/portage/sys-devel/binutils-2.25.1-r1/work/build/gold'
Makefile:865: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/var/tmp/portage/sys-devel/binutils-2.25.1-r1/work/build/gold'
Makefile:616: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/var/tmp/portage/sys-devel/binutils-2.25.1-r1/work/build/gold'
Makefile:6072: recipe for target 'all-gold' failed
make[1]: *** [all-gold] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-devel/binutils-2.25.1-r1/work/build'
Makefile:832: recipe for target 'all' failed
make: *** [all] Error 2
 * ERROR: sys-devel/binutils-2.25.1-r1::gentoo failed (compile phase):
 *   emake failed
Comment 1 Pál Csányi 2016-07-12 08:46:57 UTC
Created attachment 440422 [details]
emeerge -pqv
Comment 2 Pál Csányi 2016-07-12 08:47:27 UTC
Created attachment 440424 [details]
environment
Comment 3 Mike Gilbert gentoo-dev 2016-07-13 02:07:04 UTC
> armv7a-hardfloat-linux-gnueabi-g++: internal compiler error: Killed (program cc1plus)

Please check dmesg for errors about killed processes.
Comment 4 Pál Csányi 2016-07-13 06:50:42 UTC
This happen on my Raspberry Pi 2 Model.
Comment 5 Pál Csányi 2016-07-13 07:25:05 UTC
I just checked out dmesg for errors about killed processes.
I run 'dmesg -w' for this.
Then I start 
'pump emerge -j --update --deep --with-bdeps=y --newuse @world'
and wait.
I get the same error as yesterday.
dmesg shows nothing new during this.
Comment 6 Florian E. Teply 2016-07-13 07:45:10 UTC
I'd bet the build fails because at some point cc1plus is killed as the system runs out of memory. 
In that case, dmesg should say so. It looks like that:

[80150.151940] Out of memory: kill process XXXX (cc1plus) score 343 or sacrifice child
[80150.151944] Killed process XXXX (cc1plus) 

As the Raspberry is somewhat limited on memory, MAKEOPTS set at -j4 is pretty taxing.

I'd try 
MAKEOPTS="-j1" emerge --oneshot binutils
.
Comment 7 Pál Csányi 2016-07-13 10:00:09 UTC
Success!
(In reply to Florian E. Teply from comment #6)
> I'd bet the build fails because at some point cc1plus is killed as the
> system runs out of memory. 
> In that case, dmesg should say so. It looks like that:
> 
> [80150.151940] Out of memory: kill process XXXX (cc1plus) score 343 or
> sacrifice child
> [80150.151944] Killed process XXXX (cc1plus) 
> 
> As the Raspberry is somewhat limited on memory, MAKEOPTS set at -j4 is
> pretty taxing.
> 
> I'd try 
> MAKEOPTS="-j1" emerge --oneshot binutils
> .

Success!
There was a dmsg message:
[618774.466392] Out of memory: Kill process 29585 (cc1plus) score 252 or sacrifice child
[618774.466405] Killed process 29585 (cc1plus) total-vm:275664kB, anon-rss:250712kB, file-rss:104kB

but I was thinking that that it left out there and it should not apply to this case. Sorry!
But now, with this command:
MAKEOPTS="-j1" emerge --oneshot binutils
there was no new such message anymore.

So what should I do to avoid such issue in the future?
I'm using distccd, but still was getting this message: out of memory.
Should I put MAKEOPTS="-j4" in make.conf file?
grep processor /proc/cpuinfo
output this:
processor : 0
processor : 1
processor : 2
processor : 3
Comment 8 Pál Csányi 2016-07-13 10:01:23 UTC
I successfully emerge binutils package.
Comment 9 Florian E. Teply 2016-07-13 11:00:28 UTC
> So what should I do to avoid such issue in the future?
> I'm using distccd, but still was getting this message: out of memory.

Well, judging from the log you provided, distcc was not successfully used in that specific build process. And in that case the build is done locally.

> Should I put MAKEOPTS="-j4" in make.conf file?
> grep processor /proc/cpuinfo
> output this:
> processor : 0
> processor : 1
> processor : 2
> processor : 3

If you indeed have four cores available, then it absolutely makes sense to leave MAKEOPTS at "-j4" in order to make use of the available cores during compilation as that in general speeds up the process. There are a few cases however where the limitation is not processing power but RAM, and in these cases, having four compiler processes running simultaneously is not such a good idea as they compete for the limited amount of RAM available. 
So, my suggestion is to leave the setting as is. In most cases it just works the way it is expected to. When compilation fails, you now know the signs to look for (Out of memory message in dmesg output), and then you know to re-emerge that specific packet with MAKEOPTS="-j1". This usually is worth a try also when emerge fails for other reasons.
Comment 10 Pál Csányi 2016-07-13 11:35:27 UTC
(In reply to Florian E. Teply from comment #9)
> > So what should I do to avoid such issue in the future?
> > I'm using distccd, but still was getting this message: out of memory.
> 
> Well, judging from the log you provided, distcc was not successfully used in
> that specific build process. And in that case the build is done locally.

Indeed. I fixed it now.

> So, my suggestion is to leave the setting as is. In most cases it just works
> the way it is expected to. When compilation fails, you now know the signs to
> look for (Out of memory message in dmesg output), and then you know to
> re-emerge that specific packet with MAKEOPTS="-j1". This usually is worth a
> try also when emerge fails for other reasons.

OK
In make.conf I have not any MAKEOPTS option now. I never had MAKEOPTS option out there so far, and I removed it now. Is this right?

I shall do in the future as you advices me. Thank you very much!