gcc - How to call a C compiler through library instead of via system call? -
In a project I have been asked to modify, there is a section of code to create just one set Similar is the instruction of the assembly, writing them in a file, and then compiling it with the GCC compiler.
My question is, is there a way to link in a library that this work for me is an Export API call? I need a similarity of 1-1 in the following command:
GCC-M32-C o Ojjam Generate-Asm-Asm-MSM = Intel
You can not do this at all You may be in the fork
GCC compilation order. This is probably the operating system specific, I think you are on Linux (or some other system).
However, the options are:
- using the x86 machine
- and its
libtcc
library - Normal lisp (like) or
such as one can compile the string with the ASM code; be careful, the compiled machine code is slower than it is slowing down) Coding in Metaprogramming language, such as using a GIT library, you can only create GCC compile, generate some generated C file genfoo.c < / Code> is being loaded dynamically in a shared object (
gcc -Wall -O -fPIC genfoo.c -shared -o genfoo.so
) ./ genfoo.so
File (See also)
PS The next GCC 5.0 release will have a ( libgccjit
).
Comments
Post a Comment