Questions tagged [gcc]

Questions regarding GNU Compiler Collection Suite.

1
vote
0answers
163 views

How do I install newer or older versions of GCC on Devuan/Debian?

Some distributions come with package sets for different versions of GCC, which you can easily install in parallel; others do not. Specifically, in Devuan ASCII / Debian Stretch, there only seem to be ...
9
votes
2answers
1k views

What sets fs:[0x28] (stack canary)?

From this post it is shown that FS:[0x28] is a stack-canary. I'm generating that same code using GCC on this function, void foo () { char a[500] = {}; printf("%s", a); } Specifically, I'm ...
3
votes
1answer
8k views

How to install a functional ARM cross-gcc toolchain on Ubuntu 18.04?

Context I recently installed Ubuntu 18.04, Linux foobar-VirtualBox 4.15.0-23-generic #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux on a VM. I want to cross-compile ...
-1
votes
1answer
965 views

What does the -O2 option for gcc do? [closed]

What does the -O2 option for gcc do? eg. gcc -O2 file1.c -o file1.o
1
vote
1answer
478 views

Difference between the linker flags

I'm adding c++ runtime and exception support to the Linux kernel. For that, I need to provide my own lib/gcc and lib/libstdc++instead of the standard libraries provided by the compiler. So, I am ...
0
votes
2answers
985 views

Where is stddef.h defined in Linux?

If I want to find the values of stddef.h, where is it defined? The /usr/include/linux/stddef.h almost has nothing, /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef ...
-2
votes
1answer
232 views

error: types may not be defined in ‘sizeof’ expressions

I'm trying to compile linux kernel verison 4.14.41 and got the following error: ./arch/x86/include/asm/acpi.h: In function ‘void arch_acpi_set_pdc_bits(u32*)’: ./include/linux/build_bug.h:30:45: ...
3
votes
1answer
451 views

How to install php7 on solaris 10 with OpenSSL 1.0.1

I am trying to install php7 on Solaris 10. OpenSSL 1.0.1 was installed from https://www.opencsw.org/packages/libssl1_0_0/ To check for the installed ssl I did pkginfo -i | grep -i "ssl" and I ...
0
votes
2answers
974 views

How to build a gcc-4.9.0 successfully on solaris 10 sparc

I am trying to build a gcc-4.9.0 on solaris 10 sparc. gmp was successfully built and install at /application/gmp-6.0.0a mpfr was also successfully built and install at /application/mpfr-3.1.2 ...
5
votes
2answers
996 views

How to correctly extract a .tar.gz with md5.sum on solaris 10

I am trying to extract a gcc-4.9.0.tar.gz downloaded from one of the gcc mirror site. In order to check the md5 signature on it before I gunzip it I did digest -a md5 -v gcc-4.9.0.tar.gz which ...
1
vote
1answer
203 views

Error during static build of libvorbis and libmp3lame

I'm having trouble trying to build a static binary of ffmpeg - I've got almost the whole build working, with the exception of two libs - libvorbis and libmp3lame. These two libs are failing during ./...
-1
votes
1answer
850 views

Why configure/build gcc takes much more time than apt-get install gcc [closed]

Wander to make some modification on libgomp (gcc's OpenMP runtime library), I downloaded the source code of GCC8, and tried to configure/make the whole compiler. The configuration phase terminated ...
1
vote
1answer
71 views

Running gcc from prefix folder

I have a user account on RHEL 6.7. The built-in gcc does not support c++11, so I am trying to install my a more recent gcc. I have run configure with --prefix=$HOME/dependencies/gcc , make, make ...
2
votes
1answer
102 views

Where is “gcc_tooldir”

Under Cross-Compiler-Specific Options, it says: The default value, in case --with-sysroot is not given an argument, is ${gcc_tooldir}/sys-root. but it appears that gcc_tooldir is not defined. Is ...
0
votes
0answers
64 views

Cannot install GCC ld error not using custom prefix when loading lto-wrapper

I am trying to install GCC 4.9.4 in a non-standard location on Red Hat Linux using the documentation provided. https://gcc.gnu.org/install/ I do not have sudo, but I have write access to the folder /...
1
vote
1answer
26 views

djvulibre-3.5.27 Build Error

I am currently on Linux Mint 18.3. I downloaded the package from the Djvulibre website. Here is my error: make[2]: Entering directory '/home/amucs/Downloads/djvulibre-3.5.27/desktopfiles' PNG ...
0
votes
2answers
1k views

Compile old kernel with new gcc

I'm trying to compile an older version of Linux (3.4) on my Linux box with its current gcc-6.3. But running the make command shows errors like this: scripts/kconfig/conf.o: relocation R_X86_64_32 ...
0
votes
0answers
33 views

Exonerate Error while making

I'm using ProductName: Mac OS X ProductVersion: 10.12.6 BuildVersion: 16G1212 trying to working with exonerate Tool but facing many troubles configuration just went smooth tamimis-Mac-Pro:exonerate ...
1
vote
1answer
1k views

Use libgfrotran.so.3 and GFORTRAN_1.0 on fedora 27

I am trying to use fortran code called SAMMY-8 which has its binary ready for use. I was using without any issue while I had f25 installed. When upgrading to f27 I got the following error when trying ...
2
votes
2answers
2k views

“configure: error: cannot run C compiled programs” when compiling gcc on Alpine Linux

I am trying to build gcc-7.3 on Alpine Linux. When I run make, I get these errors, checking whether the C compiler works... configure: error: in `/build/x86_64-pc-linux-gnu/libgomp': configure: error:...
1
vote
2answers
451 views

How to change the link of CC in Centos

I am writing to ask about how to choose the version of gcc during compiling. In my machine, I believe there are several version of gcc installed. Because the command 'gcc -v' returns 'gcc version 6.4....
0
votes
1answer
62 views

Why should I put the source file name before library names on compiler command line?

As a user of OpenSUSE I am used to type: gcc -lz myfile.c I was surprised that on Ubuntu this command would fail with something like: myfile.c:(.text+0x5): undefined reference to `zlibVersion' ...
0
votes
1answer
76 views

Install new development tools on old system

I run 32 bit Centos 6.9 Linux with installed development tools for it with command: yum groupinstall 'Development Tools' But it installs very old GCC and GDB. What is the best way to install newer ...
0
votes
0answers
560 views

Building newer GDB failed due C++11

I run 32 bit Centos Linux with gdb ver 7.2 on it. I need to update GDB. I got errors below while building GDB 8.1: checking whether g++ supports C++11 features by default... no checking whether g++ ...
1
vote
0answers
268 views

gcc-config: could not run/locate 'avr-gcc-ar'

I'm trying to build an arduino sketch, but it fails with error: "/usr/bin/avr-gcc-ar" rcs "/tmp/arduino_build_191139/core/core.a" "/tmp/arduino_build_191139/core/wiring_pulse.S.o" gcc-config: ...
1
vote
0answers
569 views

g++46: error trying to exec 'cc1plus': execvp: No such file or directory

I'm on FreeBSD 9.2. The gcc version is 4.2. My project needs c++11 so I install gcc 4.6 and in Codeblocks I change the build option to support c++11 and in toolchain section I write g++46 and gcc46. ...
2
votes
0answers
461 views

While compiling 32 bit binary on 64 bit Linux (ubuntu 14.04) getting wrong ELF class error “wrong ELF class: ELFCLASS64”

I have 64 bit Ubuntu 16.04 installed on my system. For some reasons i have to change root directory to a directory which is nothing but a replica of a different system with the required libraries ...
2
votes
2answers
723 views

How to investigate and fix missing libraries and/or skipping incompatible library?

I have one secret library built for CentOS 6.5 as a package. I can't build package for CentOS 7.4, make install fails on this line: $ gcc -static -O3 -Wno-long-long -funroll-loops -Wall -g -DLINUX ...
1
vote
2answers
2k views

Updating GFortran on Scientific Linux 7?

I have a software application that requires updating GFortran to a newer version before making the program. I updated gcc, but GFortran did not update. This is on Scientific Linux 7. $ gcc --...
5
votes
2answers
7k views

using ldconfig and ld.so.conf versus LD_LIBRARY_PATH

I often build various libraries from source code to play with, such as gmp-6.1.2, mpfr-4.0.1, and gcc-7.x. In doing so, I prefer to use --prefix=/usr/local/gcc-7.2.0 so I know exactly where it is ...
0
votes
1answer
881 views

./configure cannot find GCC but whereis is able to?

I have the minimal install from CentOS-7-x86_64-Everything-1708.iso running in VirtualBox. Due to an Apache HTTPD dependency issue, I am trying to configure pcre via: ./configure --prefix /usr/local/...
2
votes
1answer
12k views

gcc /usr/bin/ld: cannot find -lglut32, -lopengl32, -lglu32, -lfreegut, but these are installed

I'm trying to compile a demo project, what is using OpenGL. I'm getting this error message: But I have everything: What is happening? If I have all of the dependencies, why does it not compile? I ...
2
votes
2answers
3k views

How do I disable g++ displaying notes for errors?

When compiling, errors are often accompanied by a lengthy series of notes (cyan). Is there a g++ flag to disable this, only showing the error itself?
1
vote
1answer
5k views

GLIBCXX_3.4.21 in CentOS

I have created c++ application in Ubuntu machine. I have copied binary to Centos machine. Got error: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found I have installed packages I thought ...
1
vote
1answer
2k views

gcc build error : cannot find -lssl

Hey all, i am trying to build a project called RamCloud on CentOS Linux release 7.4.1708 this project specifically requires gcc 4.9 and with my centos i only had gcc 4.8 so i had to : completely ...
20
votes
1answer
6k views

How long does it take to compile gcc 7.3.0? [closed]

So far it's been running for about 4 hours. One thing to note is that I did not have the prerequisites and had to download them though contrib/download_prerequisites. Not sure if it adds to the ...
3
votes
2answers
2k views

Get hex-only output from objdump

Say for example I've got this C function: void f(int *x, int *y) { (*x) = (*x) * (*y); } When saved to f.c, compiling with gcc -c f.c produces f.o. objdump -d f.o gives this: f.o: file ...
0
votes
0answers
259 views

Object library not found by shared object library

I'm trying to build a shared object library but when I produce the shared object library it says the object file is not found. OSError: lib1.o: cannot open shared object file: No such file or ...
2
votes
0answers
2k views

How to install GCC 4.9 or GCC 5 on Debian Stretch?

To build an old program for use in my Debian GNU/Linux box I need either GCC 4.9 or GCC 5. GCC 6+ will not work without changing the sources (that, for several reasons, I cannot change). So I want to ...
1
vote
1answer
995 views

Installing gcc without repo's or yum

I am having issues installing gcc with Yum. I can't contact repos, and can't install developer tools either. Is there some sort of link I can wget and install at .tgz file? Here is my issue: [root@...
1
vote
0answers
270 views

How to update Solaris assembler after updating to GCC 5?

This is related to Where is GCC-5 after installing it on Solaris 11? We got GCC 5 installed thanks to @DanekDuvall. We started a round of Solaris testing... Testing on Solaris with GCC 5 is revealing ...
1
vote
0answers
243 views

Changing system wide GCC compilation options such as -DFORTIFY_SOURCE, PIE and stack_protector

This is my first StackExchange question ever, and if it is in the wrong place (UNIX and Linux vs. somewhere like Software Engineering?) please point me right! A very long time ago, I built a system ...
8
votes
5answers
27k views

How to install a specific version of GCC in Kali Linux?

This question appears to be addressed properly in several questions and other places easily found with Google, but I don't find the solution satisfactory for the reasons explained below. But just for ...
1
vote
1answer
163 views

sh4gcc cross-compiler installation for Centos 7

I am trying to compile a program which requires sh4gcc cross-compiler and I'm not able to find any rpm package which provides sh4gcc compiler. On executing this command [root@localhost stapp]# make ...
0
votes
0answers
163 views

Local machine libraries when cross compiling

I am cross-compiling a library to an ARM arch. So as an example, in Ubuntu 16, the error message in config.log after running configure was: cc1 libstdc++.so.6: cannot open shared object file file ...
0
votes
1answer
1k views

Linux Mint gcc++ : can't install gcc++ because of broken packages

I am a student of CS and new to Linux Mint 18.2. I am trying to run a simple project in Clion but apparently I have a problem with my gcc++ compiler. I try to run this command in terminal: sudo apt-...
3
votes
3answers
3k views

How can I resolve this libgomp1 dependency issue?

I'm trying to build and install ccminer on Ubuntu 16.04 and getting the following error: scrypt.cpp:(.text+0xa55b): undefined reference to `GOMP_parallel' scrypt.cpp:(.text+0xa6cd): undefined ...
0
votes
0answers
922 views

binary can't find specific library, but can find others in the same directory

I have a binary that I can compile with either clang or gcc, and the directory for the application is something like this: /app root dir /bin /<application> /lib /<application ...
0
votes
1answer
53 views

Does ARM platform have a universal tool chain / compiler?

Recently I tried to make my own cross-compile toolchain for a arm platform. I noticed with the autoconf script of GCC, I have to pass variables like: --with-cpu=cortex-m4 \ --with-fpu=fpv4-sp-d16 \ --...
4
votes
2answers
306 views

Does kernel need to be compiled in same dev environment as userspace?

Lets say my userspace (packages) are compiled with gcc 4.7 and libc6 2.13 (Debian Wheezy) Can I compile linux kernel under different dev environment, such as gcc 6.3 and libc6 2.24 (ie, under Debian ...