Questions tagged [compiler]
87 questions
67
votes
9 answers
Can we get compiler information from an elf binary?
Is there some chance to know how a binary was built, under Linux? (and or other Unix)
Compiler, version, time, flags etc...
I looked at readelf and couldn't find much, but there might be other ways at analyzing the binary code/section…
elmarco
- 1,434
- 1
- 14
- 13
64
votes
4 answers
How to compile the C compiler from scratch, then compile Unix/Linux from scratch
Let's say I work for a large services organisation outside the US/UK. We use UNIX and Linux servers extensively.
Reading through this article it mentions that it would be easy to insert a backdoor into a C compiler, then any code compiled with that…
David J
- 743
- 6
- 6
33
votes
3 answers
Do C compilers discard unused functions when statically linking to .a file?
Say I have a C program main.c that statically links to libmine.a. Statically linking to a library causes library functions to be embedded into the main executable at compile time.
If libmine.a were to feature functions that weren't used by main.c,…
Izzo
- 999
- 1
- 8
- 15
23
votes
2 answers
How do I compile something for Linux if I don't have enough space for installing GCC?
I purchased a Human Machine Interface (Exor Esmart04). Running on Linux 3.10.12, however this Linux is stripped down and does not have a C compiler. Another problem is the disk space:
I've tried to install GCC on it but I do not have enough disk…
NielsStenden
- 345
- 2
- 7
21
votes
3 answers
Are compiled shell scripts better for performance?
After some googling, I found a way to compile BASH scripts to binary executables (using shc).
I know that shell is an interpreted language, but what does this compiler do? Will it improve the performance of my script in any way?
adazem009
- 611
- 1
- 6
- 10
15
votes
2 answers
How can I get a binary from a .py file
I need a program to compile python source code; as I found out at first I need to make a binary file from my python script.
I've already checked a lot of links, but still I haven't found something for Linux.
I found py2bin for OS/X, but there are…
TrueBad0ur
- 193
- 1
- 1
- 7
12
votes
2 answers
Why can't I run this C program?
I'm trying to run my first "process" program, but I get the following error :
./fork.c: line 4: syntax error near unexpected token `('
./fork.c: line 4: `int main()'
I'm pretty sure that the code is correct:
#include
#include…
Engine
- 261
- 2
- 5
11
votes
3 answers
How does make continue compilation?
I know that I can interrupt a make process anytime without having to recompile the entire source tree again. As I know, make only compiles a target if it's not compiled yet, or the source code is modified after the last compilation.
But if I…
psimon
- 1,212
- 10
- 26
8
votes
2 answers
How can I get a static C compiler?
I'm playing around with chroot environments, and I'd like to have a portable C compiler so that I can easily set up some basic build-tools in each environment without having to move too many libraries around.
Gcc seems pretty bloaty for what I want…
math4tots
- 2,665
- 8
- 32
- 42
6
votes
2 answers
Want to turn off "note" level messages in GCC
When I compile a C (no pluses) program using GCC, there are several levels of messages possible, like warning, error, and note. The note messages are useless and distracting. How do I make them go away using the command line? (I don't use any…
Jennifer
- 259
- 2
- 8
6
votes
1 answer
How to understand this TMG's assembly code from the Version 6 Unix?
Early versions of Unix included Doug McIlroy's tool tmg ("transmogrifier"), an early compiler-compiler. TMG was implemented in Dennis Ritchie's assembly language as well as in TMGL itself (the language that TMG translates into assembly).
Here is…
Andriy Makukha
- 548
- 4
- 14
6
votes
1 answer
Does POSIX mention cc or only c99?
I know that the most recent versions of POSIX specify that a C99-compliant compiler should (optionally) be present and called c99. Similarly, older versions of POSIX used to specify an optional c89 command to exist as part of the "C-Language…
Stefano Sanfilippo
- 278
- 1
- 7
6
votes
1 answer
Replace FreeBSD base clang with ports clang
FreeBSD 10 was the first release that officially released with Clang as the default, base compiler.
Most ports, unless specially marked, now compile using the base ("pre-installed") clang.
However, clang development is moderately rapid, and so the…
antiduh
- 367
- 2
- 10
5
votes
1 answer
What distribution-maintained cross-compile toolchain packages exist?
I have just learned of Gentoo's sys-devel/crossdev package. This is a package that is useful for creating a cross-compiling toolchain.
Are there any other such packages out there on other distributions?
I'm specifically interested in…
Shawn J. Goff
- 45,338
- 25
- 134
- 145
5
votes
2 answers
gcc - error: no acceptable C compiler found in $PATH
I am trying to install GCC from source. I am following the instructions on the wiki at https://gcc.gnu.org/wiki/InstallingGCC and also on this question on SO.
I am running into issues on the configure step when running:
$PWD/../gcc-4.6.2/configure…
Gerald Murphy
- 155
- 1
- 1
- 6