Skip to main content
64 votes
Accepted

How long does it take to compile gcc 7.3.0?

After about 4.5 hours it finished. P.S. Not sure why this question deserved a negative rating. Hopefully it will still help some folks, should they find their compile time take excessively long.
Ya.'s user avatar
  • 1,293
45 votes

Is the standard C library loaded by default in main memory in Linux?

The kernel is written in C, but it doesn’t use the C library (as dave_thompson_085 points out, it’s “freestanding”). Even if it did, a C library loaded along with the kernel for the kernel’s use would ...
Stephen Kitt's user avatar
37 votes

gcc error installing psycopg2 package for python3 on Centos 7.3

For Ubuntu use sudo apt install libpq-dev
aandrukhovich's user avatar
35 votes
Accepted

What is the gold linker?

The gold linker was designed as an ELF-specific linker, with the intention of producing a more maintainable and faster linker than BFD ld (the “traditional” GNU binutils linker). As a side-effect, it ...
Stephen Kitt's user avatar
28 votes
Accepted

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

It's easy to track this initialization, as for (almost) every process strace shows a very suspicious syscall during the very beginning of the process run: arch_prctl(ARCH_SET_FS, 0x7fc189ed0740) = 0 ...
Danila Kiver's user avatar
  • 1,282
27 votes
Accepted

gcc - unknown switches (absent also from the manpage)

The option is shown as "-l_library_" (no space) or "-l _library_" (with a space) and c is the library argument, see https://linux.die.net/man/1/gcc -lc will link libc (-lfoobar would link libfoobar ...
Bodo's user avatar
  • 6,441
24 votes
Accepted

What packages the man pages for GCC on Debian 10 Buster / Testing?

The manpages are provided in contrib packages, gcc-doc etc. (See the links at the top-right of the linked page for all the releases where the package is available.) Debian 10’s default compiler is GCC ...
Stephen Kitt's user avatar
24 votes
Accepted

Can not execute "Hello, World!" C program with user other than 'root'

Is it something related NOEXEC flag? Yes; presumably /home is mounted noexec, which means you can’t run binaries there. /tmp/user/1000 works because it’s a on different file system, as is /root (root’...
Stephen Kitt's user avatar
21 votes

Is the standard C library loaded by default in main memory in Linux?

Is the standard C library loaded by default in main memory in Linux? No. The first userspace process the kernel ever starts is called init, and its purpose is to start everything else, and to reap ...
None's user avatar
  • 211
18 votes
Accepted

How to link to a shared library with a relative path?

If we (for the moment) ignore the gcc or linking portion of the question and instead modify a binary with patchelf on a linux system $ ldd hello linux-vdso.so.1 => (0x00007ffd35584000) ...
thrig's user avatar
  • 35.8k
18 votes

What is the gold linker?

The gold linker was written to make the link process considerably faster. According to the gold auther Ian Lance Taylor At the moment gold has only one significant advantage over the existing ...
suspectus's user avatar
  • 6,218
13 votes

What is libstdc++.so.6 and GLIBCXX_3.4.20?

What is libstdc++.so.6? Is this just a library that gcc ships with? It’s GCC’s implementation of the C++ Standard Library. What are all the different GLIBCXX_*? Are these also libraries? These are ...
Stephen Kitt's user avatar
13 votes
Accepted

GCC does not throw warnings and compiles erroneous code

On GCC, format string checks are controlled by -Wformat, which isn’t enabled by default. Building your code with -Wformat (or -Wall, which includes it) does warn: $ gcc -Wformat 630368.c -o ...
Stephen Kitt's user avatar
12 votes
Accepted

Centos 7 gcc 8 installation

Now devtools-8 is available and it's possible to use it by following commands: yum install centos-release-scl yum install devtoolset-8-gcc devtoolset-8-gcc-c++ scl enable devtoolset-8 -- bash It's ...
Eenoku's user avatar
  • 1,245
12 votes
Accepted

How to statically link missing libgcc_s_seh-1.dll and libstdc++-6.dll DLLs for 9.3-win32 MinGW executable

Build your program (and mathlib.dll, if necessary) with the -static-libgcc and -static-libstdc++ options: x86_64-w64-mingw32-g++ -static-libgcc -static-libstdc++ -L. -l:mathlib.dll -o fib main.cpp ...
Stephen Kitt's user avatar
11 votes
Accepted

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

How to install a specific version of GCC in Kali Linux? GCC 6 is available on kali linux it can be installed as follow : apt install g++-6 gcc-6 To switch between gcc6 and gcc7 update-alternatives --...
GAD3R's user avatar
  • 69.9k
11 votes
Accepted

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

The meaning of -lglut32 (as an example) is, load the library glut32. The result of the ls you execute showed that you have the header file for glut32 In order to solve the problem of cannot find -l-...
Yaron's user avatar
  • 4,379
11 votes
Accepted

Where do I get "Development Tools" for CentOS 7 when trying to install via yum?

In your console output it says: Maybe run: yum groups mark install (see man yum)—did you do this? Try running the following commands: yum groups mark install "Development Tools" yum groups mark ...
ThatsWhatSheCoded's user avatar
10 votes
Accepted

How to temporarily change default version of gcc in ArchLinux

TLDR: sudo ln -s $(which gcc-5) /usr/local/bin/gcc; hash -r By default, the gcc binary is located in /usr/bin Checking our path, we see that /usr/local/bin comes first: echo $PATH | tr ':' '\n' /...
l3x's user avatar
  • 234
10 votes
Accepted

How are stack canary pollutions logged?

Stack smashing is detected by libssp, which is part of gcc. It tries very hard to output the message to a terminal, and only if that fails does it log to the system log — so in practice you’ll see ...
Stephen Kitt's user avatar
10 votes
Accepted

No gcc executable after pkg_add gcc on OpenBSD

The GNU C compiler executable is called egcc when it's installed from the gcc package. There should also be a gcc executable in /usr/bin (the gcc of the base system, at least on amd64). $ type egcc ...
Kusalananda's user avatar
  • 356k
9 votes

How to handle error compiling GCC 4.7.0 using GCC 6.2.1

I agree that using a newer gcc is often not a good option. I had to write a new program for an embedded ARM v4 system running Pengutronix stuck at a 2.6 kernel and an old glibc. Therefore I had to ...
AxelBe's user avatar
  • 91
9 votes
Accepted

gcc build error : cannot find -lssl

Both errors are related to the OpenSSL development libraries not being installed ( -lssl is a pretty dead giveway). The -lssl can be divided into -l, meaning "link with", and ssl, which is the ...
Rui F Ribeiro's user avatar
9 votes

using ldconfig and ld.so.conf versus LD_LIBRARY_PATH

The solution to this is to add your library directories /usr/local/gcc-7.3.0/lib/ to /etc/ld.so.conf (or a file in /etc/ld.so.conf.d/) and run ldconfig or change users' shell profiles to override the ...
Pedro's user avatar
  • 2,051
9 votes
Accepted

How can i put the gcc warning messages in a text file?

You can redirect the output, say your program is: main() { } When you compile, gcc will say something like: a.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int] main() ^~~~ That is ...
Eduardo Trápani's user avatar
9 votes

Compiling stand-alone function binaries from the Linux kernel

To add to Stephen Kitt's answer and explain it a bit more deeply... The entire purpose of the kernel and kernel device drivers is to interface to hardware in ways that it is not safe for user level ...
user10489's user avatar
  • 10.9k
8 votes
Accepted

Are there any successful forks or refactors of the Linux Kernel?

I am specifically wondering about the kernel and whether there are forks that eliminate gcc/gnu dependencies-- No-one is going to finish the work syncing up clang & Linux and then maintain that as ...
sourcejedi's user avatar
  • 53.5k
8 votes

gcc - unknown switches (absent also from the manpage)

-lc links with libc, the C library. See the description of -llibrary in the documentation.
Stephen Kitt's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible