top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

GCC Build Error on 32bit RadHat?

+2 votes
473 views

I am building gcc 4.8.1 in a Red Hat 6.4 64 bit machine. I am building gnat first and it is build as 32 bit i686 architecture. I used gnat-gpl-2013-i686-pc-linux-gnu-bin for gnat and it created a 32 bit gcc in the directory, I set the path to that so, gcc is now gcc 4.7.4 from /gnat/bin/gcc. When I checked that is 32 bit gcc.

I used this configuration

./gcc-4.8.1/configure --disable-multilib --disable-bootstrap
--disable-install-libiberty --with-system-zlib --enable-clocale=gnu
--enable-shared --enable-lto --enable-threads=posix --enable-__cxa_atexit
--enable-languages=c,c++,fortran,java,ada --prefix=/usr/local/ CFLAGS="-pipe
-march=native -mtune=native -g -O2" CXXFLAGS="-pipe -march=native
-mtune=native -g -O2"

I was able to build the compiler with this configuration and arch is x86_64.

when I tried to compile a file with -m32 option it didn't work and got the error message

crtbegin.o: could not read symbols: File in wrong format.
Collect2: kd returned 1 exit status
posted Feb 20, 2014 by Deepak Dasgupta

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

On x86_64, the --disable-multilib option means build a compiler without 32-bit support. Which may be the cause of the problem.

answer Feb 20, 2014 by Majula Joshi
Similar Questions
+2 votes

we are trying to compile Android Jellybean (JB43) and It uses Toolchain GCC 4.7 with this toolchain we are seeing this error:

Error: selected processor does not support requested special purpose register -- `mrs r5,FPEXC

Is there a way to fix this. I use arm v7-a

+1 vote

I need some help in understanding why my GCC didn't consider this an issue. I have a function that was constructing a path to a daemon program based on the location of the shared object file where this code is. Something similar to this:

namespace {
 std::string ConstructPath()
 {
 int lastSlash(0);
 std::string pathVar;
 Dl_info dl_info;
 memset(

 if((dladdr((void*)ConstructPath, 
 }

 pathVar = dl_info.dli_fname;
 lastSlash = pathVar.find_last_of('/');
 if(std::string::npos == lastSlash)
 {
 // no slashes given ... must be that *.so
 // is in the current directory
 pathVar = "mydaemond";
 }
 else
 {
 pathVar.erase(pathVar.begin() + (lastSlash + 1), pathVar.end());
 pathVar.append("mydaemond");
 }

 // first check if we can find the daemon
 {
 // introducing sub-scope to ensure the file object is closed
 std::ifstream test(pathVar.c_str());
 if(!test.good())
 {
 throw std::runtime_error("cannot find mydaemond");
 }
 }

 // *** the below statement wasn't there originally, the
 // *** function simply exited after the forced-scope block above,
 // *** however, the function *did* have the return type
 return pathVar;
 }
}

My comments above the final return statement illustrate what my question is about. Why wasn't this a problem? There was no return statement and yet, the code compiled fine. I'm using GCC 4.4.4 on CentOS 6.2. Is this just a problem with the 4.4.4 compiler that was fixed? I'm betting there's some subtlety in C++ here that I'm not yet aware of and I'd like to be schooled.

+3 votes

I am following instructions from
https://gcc.gnu.org/wiki/Offloading

I'm using the configure line for Nvidia ptx. The build stops in configuring nvptx-none/libgfortran with error:

checking whether symbol versioning is supported... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.

My host OS is CentOS 6.5. I'm using gcc 4.7 (built with system gcc 4.4) to build gcc 5.1

Can someone give me hint to look where the problem could come from ?

+1 vote

In attempts to build the gomp_4.0 branch from svn (on CentOS 6.2), I find that I must remove the -Werror option in STRICT_WARN. I don't find documented how this should be done (in configure ?). I can get past it by repeatedly modifying gcc/Makefile, but this seems wrong.
I have little interest at this stage in finding out why it triggers -Werror=maybe-uninitialized in typeck.c; I'd only like to build the gcc to see if it does anything interesting with OpenMP 4.

0 votes

I'm studying about C compiler for increasing software quality. So I want to get all of compile error message list of gcc about C language. I was trying to find it. But I can't find it anywhere. How can I find it?

Please help?

...