Solved

Steps to upgrade gcc ??

Posted on 2006-06-17
9
390 Views
Last Modified: 2008-01-09
I'm getting the following error below & I saw this bug report:  http://bugs.mysql.com/bug.php?id=9263
which makes me believe I need to upgrade gcc on my server.  OS is Fedora Core 4.  I have the following installed:

libgcc-4.0.2-8.fc4
gcc-4.0.2-8.fc4
gcc-c++-4.0.2-8.fc4


What would be the correct steps to upgrade gcc on my server?  I've already downloaded gcc-4.1.1.tar.bz2 & untarred it, but I'm lost after that.  Any help is appreciated.  Thank you.




Writing Makefile for DBD::mysql
CPAN: YAML loaded ok
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/Mysql.pm blib/lib/Mysql.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Mysql/Statement.pm blib/lib/Mysql/Statement.pm
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cc -c  -I/usr/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI/ -I/usr/include/mysql -g -march=i386 -mcpu=i686 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2   -DVERSION=\"3.0006\" -DXS_VERSION=\"3.0006\" -fpic "-I/usr/lib/perl5/5.8.7/i686-linux/CORE"   dbdimp.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
cc: Internal error: Segmentation fault (program as)
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
make: *** [dbdimp.o] Error 1
  /usr/bin/make  -- NOT OK
Running make install
  make had returned bad status, install seems impossible
0
Comment
Question by:techie411
9 Comments
 
LVL 14

Expert Comment

by:DonConsolio
Comment Utility
consider finding a .rpm for your software and install with "rpm -Uvh mypackage.rpm" (as root)
or upgrade to FC5 which sould already come with gcc-4.1.1
0
 
LVL 4

Expert Comment

by:Phreonx
Comment Utility
Hello,
before you upgrade your gcc, try ./configuring with CFLAGS="-march=[your processor architecture eg i586]". If that fails too, try -mtune=[same option you used for march]. For an explanation as to which march or mtune better reflects your hardware have a look here:

http://www.dis.com/gnu/gcc/i386-and-x86-64-Options.html

Your mysql configure command should look something like this:

CFLAGS="-march=i685" ./configure --your-configuration-options or
CFLAGS="-mtune=athlon-xp" ./configure --your-configuration-options

Hope I helped ;)
0
 
LVL 34

Expert Comment

by:Duncan Roe
Comment Utility
i685?? Last year's model:) Phreonx you meant i686 surely?
0
 
LVL 4

Expert Comment

by:Phreonx
Comment Utility
Typo ;) you're right duncan_roe.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 34

Expert Comment

by:Duncan Roe
Comment Utility
Looking at the original MYSQL bug report, it seems to me that the 4.1 mentioned therein is a MYSQL rev, not gcc. The bug report concerns a warning only - you have a seg fault which is a whole new ball game.
The output you posted invites you to submit a gcc bug report - certainly it would be a good idea to upgrade to gcc4.1 before doing that. OTOH, gcc reports the segfault occurred in as - the GNU assembler. This is not a part of gcc. I think it comes with binutils but it seems to have its own revision number: I see:

08:28:00$ as --version
GNU assembler 2.15.90.0.3 20040415
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-redhat-linux'.

You might want to get a recent "as" before you upgrade gcc.

I just tried building gcc 4.1.1 from source - much easier than it used to be - but I am seeing 10 failures in "make check".  That compares with 38,208 expected passes so may not be too serious, anyway I've built it to install in an experimental dir so it can't do much harm. I'd recommend you do the same - then change your PATH to pick up the new gcc before retrying the SQL build.

Post if you'd like details of what I did (so you can try it)
0
 

Author Comment

by:techie411
Comment Utility
Hi Duncan:

I found out the problem was w/ bad memory after running memtest.  Everything is compiling fine now after swapping the RAM.  I appreciate your response & offer however.  It'd probably be a good idea for you to post the details anyway for the experts-exchange community for anyone looking up how to compile gcc, they can get the details.  Once you do this, I'll go ahead & send you your points =).  Thank you for your help.  It was much appreciated!! =)

0
 
LVL 34

Accepted Solution

by:
Duncan Roe earned 500 total points
Comment Utility
Following the advice in BUILD, I build in a totally separate directory from where the source was restored to - in my case /build/gcc4.1.1.
This is the script I use to configure:

08:07:05$ cat confline
unset ARCH SRC TARGET
ARCH=amd64
SRC=/usr/src/gcc-4.1.1
ARCH=${ARCH:-i486}
TARGET=${TARGET:-$ARCH-pc-linux-gnu}
(time nice $SRC/configure \
  --prefix=/usr/local64/gcc402 \
  --enable-shared \
  --enable-threads=posix \
  --enable-__cxa_atexit \
  --disable-checking \
  --with-gnu-ld \
  --target=${TARGET} \
  --host=${TARGET} \
  --build=${TARGET} \
  )2>&1|tee heeconf
unset ARCH SRC TARGET

I dot that. heeconf is a record of the session (to compare with previous revisions, possibly). Things to note: --prefix of some random test dir; architecture may vary. Then:

make bootstrap

That builds everything. Now make sure it's OK:

make -j 8 check 2>&1|tee hee

I use -j 8 because I have a dual opteron. -j 4 is likely adequate for a single-processor (this lets the expect scripts run in parallel - while one script is waiting for a response, another script can be running).
keeping the output in a hee file is handy for checking afterwards if anything went wrong, and submitting a bug report to the good guys who maintain gcc (after checking first that it's not a known problem;)
Ok, now install it

make install

To enable the new compiler, I us this script:

08:28:32$ cat `type -p gcc4`
#!/bin/sh
export PATH=/usr/local64/gcc402/bin:$PATH
exec bash

This starts a new shell one level up. In this shell, "gcc" is found at "/usr/local64/gcc402/bin/gcc". When done experimenting, type "exit" to recover your original environment.

Ok that's it. Now I'll go off and check whether the "make check" errors I encountered are known about, else I'll report them.
0
 
LVL 34

Expert Comment

by:Duncan Roe
Comment Utility
I raised a bug report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28137
The failure may not be with gcc at all.
0
 
LVL 34

Expert Comment

by:Duncan Roe
Comment Utility
It seems to be better to use x86_64 rather than amd64 - "make check" appears to check more things. I.e.:

15:19:25$ cat confline
unset ARCH SRC TARGET
ARCH=x86_64
SRC=/usr/src/gcc-4.1.1
ARCH=${ARCH:-i486}
TARGET=${TARGET:-$ARCH-pc-linux-gnu}
$SRC/configure \
  --prefix=/usr/local64/gcc402 \
  --enable-shared \
  --enable-threads=posix \
  --enable-__cxa_atexit \
  --disable-checking \
  --with-gnu-ld \
  --target=${TARGET} \
  --host=${TARGET} \
  --build=${TARGET} \
  2>&1|tee heeconf
unset ARCH SRC TARGET
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now