[x86_64] Compiling with gcc on Threos
Posted: Thu Apr 26, 2018 2:28 pm
Once you installed the gcc package, you will be able to compile C sources files with gcc:
The following examples can be done in the /usr/src/examples directory (from the examples package).
To compile hello1.c into a PIE (Position-Independent Executable, uses GOT/PLT and dynamically links to the libc, and other libraries):
To compile a static executable (does not use dynamic libraries):
Code: Select all
# pkman -Syu gcc
To compile hello1.c into a PIE (Position-Independent Executable, uses GOT/PLT and dynamically links to the libc, and other libraries):
Code: Select all
$ gcc hello1.c
Code: Select all
$ gcc -mcmodel=large -static -fno-pie -fno-pic -Wl,-Nqx,--start-group,-ldevlib,-lkrnlext hello1.c