I have this wierd issue while trying to bootstrap gcc. I installed a binary of gcc 4.0.0 from the AIX download page. That works well on other apps but once I try to bootstrap gcc with it, it looks like it is running fine then bails with this error: "out of memory allocating 16 bytes after a total of 4161654796 bytes" I have already tried to increase my user limits on resources and I have everything set to unlimited, which may or may not be good. Any ideas? Let me know what other info you may need. Thanks.
forgot: This is on AIX 5.3. bash-3.00$ emerge --info Portage 2.2.00.7595-prefix (default-prefix/aix/5.3.0.0/ppc, gcc-4.0.0, unavailable, 3 0005C32D4C00) ================================================================= System uname: 3 0005C32D4C00 unknown Unknown Host Operating System Timestamp of tree: Wed, 12 Sep 2007 13:36:24 +0000 ACCEPT_KEYWORDS="ppc-aix ~ppc-aix" CBUILD="powerpc-ibm-aix5.3.0.0" CHOST="powerpc-ibm-aix5.3.0.0" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf" DISTDIR="/home/jolexa/portage/aix/usr/portage/distfiles" EPREFIX="/home/jolexa/portage/aix" FEATURES="collision-protect distlocks metadata-transfer nostrip sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" PKGDIR="/home/jolexa/portage/aix/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*" PORTAGE_TMPDIR="/home/jolexa/portage/aix/var/tmp" PORTDIR="/home/jolexa/portage/aix/usr/portage" SYNC="svn+http://overlays.gentoo.org/svn/proj/alt/trunk/prefix-overlay" USE="cracklib midi ncurses ppc-aix prefix readline ssl zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="AIX" INPUT_DEVICES="keyboard mouse" KERNEL="AIX" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" Unset: CFLAGS, CTARGET, CXXFLAGS, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY bash-3.00$ bash-3.00$ env EPREFIX=/home/jolexa/portage/aix PWD=/home/jolexa/portage/aix SHLVL=1 _=/home/jolexa/portage/aix/tmp/usr/bin/env bash-3.00$
You do not use GNU binutils I assume. Which versions of sed/awk/make are in use ? Can you find out which binary exactly goes out of memory during your build ? And: I have never used ibm-shipped gcc-4 binary. gcc should bootstrap with xlc just fine, although bootstrapping gcc-4.1.1 works here with gcc-3.3.6 from /usr/local (within prefix-launcher) - but I'm unsure if that gcc-3.3.6 is an ibm-shipped or self built one. And this self-built gcc-4.1.1 (from prefix-launcher) is able to bootstrap the gcc-4.1.1 from portage tree...
(In reply to comment #2) > You do not use GNU binutils I assume. > Which versions of sed/awk/make are in use ? I'm don't have access to that computer right at the moment but I have bootstrapped python, coreutils, findutils,tar, patch, grep, gawk, & binutils from the bootstrap script so I have whatever version they provide. And I got sed from prefix-launcher so it had the aix-malloc pathch on it. I also manually compiled GNU make v3.81. > Can you find out which binary exactly goes out of memory during your build ? Eh, easy way to do that? > And: > I have never used ibm-shipped gcc-4 binary. > > gcc should bootstrap with xlc just fine, although bootstrapping gcc-4.1.1 works > here with gcc-3.3.6 from /usr/local (within prefix-launcher) - but I'm unsure > if that gcc-3.3.6 is an ibm-shipped or self built one. I tried prefix-launcher first and ran out of memory with that too. same issue. > And this self-built gcc-4.1.1 (from prefix-launcher) is able to bootstrap the > gcc-4.1.1 from portage tree... >
(In reply to comment #3) > > Can you find out which binary exactly goes out of memory during your build ? > > Eh, easy way to do that? If this does re-occur whenever you do 'gmake bootstrap' again (immediately after the previous 'gmake bootstrap'), then I'd call these steps "easy": 0) do not have MAKEFLAGS set, or pass '--print-directory' to each gmake call. 1) gmake [--print-directory] bootstrap > bootstrap.out 2>&1 2) In this make output, find the directory where this does occur. 3) Substitute every '^\t@' with '\t' in that Makefile, to see what gmake executes. 4) gmake bootstrap > ... 5) In this new output, find the command where it occurs. 6) In the same Makefile again, find the command, and put 'set -xv;' at the beginning of that command (have an eye on multiline commands ending with \). 7) gmake bootstrap > ... 8) In this new make output, see what happens. If you need help on these steps, you can attach bzip2'd make output here. If too large, send me directly. > > > And: > > I have never used ibm-shipped gcc-4 binary. > > > > gcc should bootstrap with xlc just fine, although bootstrapping gcc-4.1.1 works > > here with gcc-3.3.6 from /usr/local (within prefix-launcher) - but I'm unsure > > if that gcc-3.3.6 is an ibm-shipped or self built one. > > I tried prefix-launcher first and ran out of memory with that too. same issue. Do you use ibm-shipped gcc-4.0.0 for prefix-launcher ? Where did you get this from ?
(In reply to comment #4) > Do you use ibm-shipped gcc-4.0.0 for prefix-launcher ? > Where did you get this from ? http://www-03.ibm.com/systems/p/os/aix/linux/download.html More importantly: I think I fixed my issue here. I read up on gcc's install tips and tricks for AIX and found that a) they recommend GNU make and b) they don't recommend GNU binutils for building gcc from scratch. So now I am bootstrapping gcc from source manually and will see how this goes. I am already miles ahead of where I was so this looks promising. I will update this later.
(In reply to comment #5) > b) they don't recommend GNU binutils for building gcc from scratch. Do not use GNU binutils on AIX at all.
After getting over the last hurdle, my bootstrap of gcc failed when it was on the configure-target-libstdc++-v3 target with this error: checking for sin in -lm... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES. make[2]: *** [configure-target-libstdc++-v3] Error 1 I could try pinging the ML too if my issues are beyond the scope of b.g.o. I don't wish to turn this into a support forum.
(In reply to comment #7) > checking for sin in -lm... configure: error: Link tests are not allowed after > GCC_NO_EXECUTABLES. Have seen similar errors on gcc-help list with cross-compiling only... How and where exactly do you: 1) unpack gcc source 2) call configure 3) call make
(In reply to comment #8) > How and where exactly do you: > 1) unpack gcc source > 2) call configure > 3) call make Since I thought I figured the original issue out (and after a power outage which killed my process) I used bootstrap.sh to bootstrap gcc again. 343 ${S}/gcc-${GCC_PV}/configure \ 344 --prefix="${ROOT}"/usr \ 345 --host=${CHOST} \ 346 --mandir="${ROOT}"/usr/share/man \ 347 --infodir="${ROOT}"/usr/share/info \ 348 --datadir="${ROOT}"/usr/share \ 349 --disable-checking \ 350 --disable-werror \ 351 --disable-nls \ 352 --with-system-zlib \ 353 --enable-languages=${GCC_LANG} \ 354 ${GCC_EXTRA_OPTS} \ 357 $MAKE ${MAKEOPTS} bootstrap-lean || exit 1
(In reply to comment #0) > "out of memory allocating 16 bytes after a total of 4161654796 bytes" Now have an aix5.2 here with exactly this error. It is 'build/genattrtab' built during bootstrap getting this error: build/genattrtab /source/gcc-4.1.1/gcc/config/rs6000/rs6000.md > tmp-attrtab.c out of memory allocating 16 bytes after a total of 4161654796 bytes
(In reply to comment #10) > (In reply to comment #0) > > "out of memory allocating 16 bytes after a total of 4161654796 bytes" > > Now have an aix5.2 here with exactly this error. > It is 'build/genattrtab' built during bootstrap getting this error: > > build/genattrtab /source/gcc-4.1.1/gcc/config/rs6000/rs6000.md > tmp-attrtab.c > > out of memory allocating 16 bytes after a total of 4161654796 bytes How are you building it? I think I have a successful build after dropping --host=${CHOST} from the configure call.
(In reply to comment #10) > build/genattrtab /source/gcc-4.1.1/gcc/config/rs6000/rs6000.md > tmp-attrtab.c > > out of memory allocating 16 bytes after a total of 4161654796 bytes It did help here to unlimit 'data seg size': $ ulimit -d 131072 $ ulimit -d unlimited $ ulimit -d unlimited What hard-limit for 'data seg size' do you have on your machine ? $ ulimit -H -d Seems that gcc-4.1.1 for genattrtab indeed requires more than 128MB of memory, which IIRC is the default (soft?) limit for 'data seg size'.
(In reply to comment #11) > How are you building it? I think I have a successful build after dropping > --host=${CHOST} from the configure call. I should add that this fixed my issue in regards to comment #7. I'm still abit lost on what was throwing the out of memory errors.
(In reply to comment #12) > It did help here to unlimit 'data seg size': > $ ulimit -d > 131072 > $ ulimit -d unlimited > $ ulimit -d > unlimited This is eventually what I did. I was just guessing on what needed to be changed and made everything unlimited. > What hard-limit for 'data seg size' do you have on your machine ? > $ ulimit -H -d unlimited > Seems that gcc-4.1.1 for genattrtab indeed requires more than 128MB of memory, > which IIRC is the default (soft?) limit for 'data seg size'. Unfortunetly, I cannot comment on what my ulimt's where that was throwing my error but I suspect they were the same as the ones that caused issues for you.
I'm unsure if we should do 'ulimit -d unlimited' in the scripts (bootstrap-prefix.sh, gcc-*.ebuild, prefix-launcher, etc.), or tell the user to do so. Can't say why, but personally I dislike doing so in the scripts...
(In reply to comment #15) > I'm unsure if we should do 'ulimit -d unlimited' in the scripts > (bootstrap-prefix.sh, gcc-*.ebuild, prefix-launcher, etc.), or tell the user to > do so. Can't say why, but personally I dislike doing so in the scripts... I agree. I'm happy with the diagnosis here. I had no idea *which* limit option it was that was affecting me, thanks for looking into it. If this happens again, I will know what the problem is. You may close this bug when you figure out what the action will be. Thanks again!
haubi, any figuring out here to do to close this bug?
Somewhat low on time - as a first resort I've added an appropriate note to http://prefix-launcher.wiki.sourceforge.net/howto+install+prefix+launcher
Found an aix linker flag: -bmaxdata:0x10000000 This increases datasize limit to 256MB for executables linked with it, not depending on the user's soft limits. Committed revision 13622.