mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-16 00:00:06 +01:00
Created Usage of Intel's C/C++ compiler (markdown)
parent
d83c04ba25
commit
a9f5b4d025
1 changed files with 21 additions and 0 deletions
21
Usage-of-Intel's-C-C---compiler.md
Normal file
21
Usage-of-Intel's-C-C---compiler.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
If you are interested to use Intel's C/C++ compiler instead of the GCC, you have to guarantee with the compiler flag `-ffreestanding` that the compiler doesn't use the standard environment of your host system. Instead of using the standard path, you have to set with the compiler flag `-I` the include path to HermitCore's environment. However, Intel's compiler creates per default object files for the host system. Our toolchain includes the program `x86_64-hermit-elfedit` that is able to convert with the flag `--output-osabi HermitCore` these files to HermitCore's object files. For linking all object files to a HermitCore executable, you have to use the linker of our toolchain because it includes a valid linker script, which is required to build a bootable executable.
|
||||
|
||||
To summarize this guideline, you find below an [abstract of a Makefile](https://github.com/RWTH-OS/HermitCore/blob/master/hermit/usr/benchmarks/Makefile), which creates a HermitCore executable for the [stream benchmark](https://github.com/RWTH-OS/HermitCore/blob/master/hermit/usr/benchmarks/stream.c).
|
||||
|
||||
ELFEDIT_FOR_TARGET = x86_64-hermit-elfedit
|
||||
CC_FOR_TARGET = x86_64-hermit-gcc
|
||||
CC = icc
|
||||
CFLAGS = -m64 -O3 -xHost -I$(TOPDIR)/hermit/usr/x86/x86_64-hermit/include/ -openmp -ffreestanding
|
||||
STRIP_DEBUG = --strip-debug
|
||||
KEEP_DEBUG = --only-keep-debug
|
||||
|
||||
default: stream
|
||||
|
||||
stream.o: stream.c
|
||||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
$(ELFEDIT_FOR_TARGET) --output-osabi HermitCore $@
|
||||
|
||||
stream: stream.o
|
||||
$(CC_FOR_TARGET) -fopenmp -o $@ $<
|
||||
$(OBJCOPY_FOR_TARGET) $(KEEP_DEBUG) $@ $@.sym
|
||||
$(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@
|
Loading…
Add table
Reference in a new issue