top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Building GCC on Ubuntu Failing?

+1 vote
1,050 views

My system is ubuntu 14.04 LTS 64 bit and I've installed build-essential. Also tried purge and reinstall libc6-dev. Doesn't work.

from /home/xxx/gcc-4.8.2-build/../gcc-4.8.2/libgcc/libgcov.c:27:
/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory

posted Jun 25, 2014 by Amit Parthsarthi

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

1 Answer

0 votes

I think you need to install libc6-dev-i386

answer Jun 25, 2014 by Dewang Chaudhary
Similar Questions
+1 vote

I'm trying to build GCC 4.7.2 with binutils 2.23.1 and am getting a compile error:

dwarf.o: In function get_TAG_name': /w/umoszkow/gcc/x86_64/binutils/../../gcc-4.7.2/binutils/dwarf.c:662: undefined reference toget_DW_TAG_name'
dwarf.o: In function get_FORM_name': /w/umoszkow/gcc/x86_64/binutils/../../gcc-4.7.2/binutils/dwarf.c:678: undefined reference toget_DW_FORM_name' dwarf.o: In function get_AT_name': /w/umoszkow/gcc/x86_64/binutils/../../gcc-4.7.2/binutils/dwarf.c:1867: undefined reference toget_DW_AT_name'
collect2: error: ld returned 1 exit status

Any idea how to get around this build problem? My arch is x86_64 and my OS is RHEL4u8WS.

0 votes

Currently I compile gcc version 6.2.1 20161117 and I'm running very simple code that use 32 gangs,

I compile it with gcc -fopenacc -o3 -o piexample.x piexample.c with the following env.

export GOMP_DEBUG=1
export ACC_DEVICE_TYPE=nvidia

The problem is that anyone number of gangs that i use, the result is always the same: only 1 gang.

GOACC_parallel_keyed: mapnum=1, hostaddrs=0x7fffc872dff0, size=0x6012c0, kinds=0x6012b8
nvptx_exec: prepare mappings
nvptx_exec: kernel main$_omp_fn$0: launch gangs=1, workers=1, vectors=32
nvptx_exec: kernel main$_omp_fn$0: finished
GOACC_data_end: restore mappings
GOACC_data_end: mappings restored

If compile it with PGI compiler the number of gangs is setter correctly,

main:
12, Generating copy(pi)
14, Loop is parallelizable
Accelerator kernel generated
Generating Tesla code
14, #pragma acc loop gang(32), worker(8), vector(8) /*blockIdx.x threadIdx.y threadIdx.x */
16, Generating implicit reduction(+:pi)

Some ideas about the problem ?

0 votes

Last time I asked GCC installation and it was very helpful. Can someone point me how to achieve it on Windows?

0 votes

We are trying to build our code base for CentOS 7 machine with x86_64 architecture on CentOS6 with x86_64.

For that we are trying to build a centos7 Toolchain. All the gcc/ld/ar should be statically linked, so that we are ensuring that it will not uses any native centos6 stuff.

In this process, we are able to generate statically linked GCC/AR/LD. But problem was this GCC not generating a statically linked binaries and fails while checking flags during configure at "checking static
flag -static ". Due to this while running those binaries it refers to native libgcc and fails.

We are using the below command for configure.

../gcc../configure -prefix=/mnt/data0/toolchain-vm-temp2 --build=x86_64-CentOS7-linux-gnu-with sysroot=/mnt/data0/tools/gnutools/toolchain-vm --disable-nls --disable-multilib --enable-languages=c,c++ --disable-sim --enable-symvers=gnu --enable__cxa_atexit --enable-lto --with-gnu-ld --enable-static

Can Anyone provide solution or how to achieve this task.

+2 votes

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
...