Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 410
  • Last Modified:

Steps to upgrade gcc ??

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
techie411
Asked:
techie411
1 Solution
 
DonConsolioCommented:
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
 
PhreonxCommented:
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
 
Duncan RoeSoftware DeveloperCommented:
i685?? Last year's model:) Phreonx you meant i686 surely?
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
PhreonxCommented:
Typo ;) you're right duncan_roe.
0
 
Duncan RoeSoftware DeveloperCommented:
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
 
techie411Author Commented:
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
 
Duncan RoeSoftware DeveloperCommented:
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
 
Duncan RoeSoftware DeveloperCommented:
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
 
Duncan RoeSoftware DeveloperCommented:
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now