Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want the GCC to exclude the startup code it link automatically with building process
what should i do?
So that i have my Own Startup assembly code defining labels (_start, _exit,..etc)
GCC provides the -nostartfiles, -nodefaultlibs and -nostdlib options. See documentation.
Alternatively, you can call linker (ld) directly: it doesn't add anything by default, all objects (including the linker script) has to be specified manually. For an example of the ld invocation, run gcc with -v option: it would print full command lines of all other tools (including linker) it invokes.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
AFAIK, Some part of C compilation phases can be multi-threaded.
For example, At least Preprocessing and Parsing (creating AST) is only related its source file itself so each file can be parallelized.
Is there any reason that GCC has no multi-threaded compile option?
You can build C/C++ in paralell if you use and setup a proper build system, which handles this for you.
Basically in C/C++ every .c/.cpp file is complied to an .o file. All these .o files are then linked to the resulting binary.
A build system (make for instance) can be used, to build all the .o files in paralell.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I recently install windows subsystem linux
when I try to execute the C program it says no directory exists
gcc one.c -one
Does not do what you want, if you want one to be name of output file use -o option as below.
gcc one.c -o one
Then,
./one
will work
By default name of the executable generated is
./a.out
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Basically what I want is to create an object file (maybe x64 ELF one) with assembly code which could then be linked with other object files in order to create one executable. Also I would like to export some addresses from this object and also to import some from the other object files it will link to.
I'll be happy if it can target linux x64 (I'm using OpenSuse now) and can be used with some default linker (like 'ld' maybe).
I want to make a compiler using 'C' language.
Just generate assembly code, and use the assembler to convert to object format.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I was browsing the go source and I wanted to build it as a standalone linker for osx that can generate mach-o files. Is there anyway to do this?
The linker is already a standalone tool. You can see it by running
go tool -n 6l
which will print the location of the 6l (x86 64 bit linker) executable.
The source code of 6l can be found in GOROOT/src/cmd/6l.
In that directory you can use make to build it.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Where is the directory normally located? For example, when you compile headers that have function prototypes which are linked to the GCC source library? I ask because I just downloaded slab.c which has the kmalloc function(got a link error from compiling another header so now I have a source code file that implements it).
This:-
`gcc -print-prog-name=cc1` -v
command is used by gcc to check for headers file.