File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,35 @@ Hello, World!
8484Refer to [ Running on nSIM] ( ./nsim.md )  and [ Running on QEMU] ( ./qemu.md )  to learn how
8585to run ARC-V examples on nSIM or QEMU simulator.
8686
87+ ## Compiling C++ applications  
88+ 
89+ Consider a simple code example:
90+ 
91+ ``` c 
92+ #include  < iostream> 
93+ 
94+ int  main ()
95+ {
96+   std::cout << "Hello, World!" << std::endl; 
97+   return 0; 
98+ }
99+ ``` 
100+ 
101+ For compiling C++ applications use ` -specs=picolibcpp.specs ` :
102+ 
103+ ``` 
104+ $ riscv64-snps-elf-gcc \ 
105+  -march=rv32imafc \ 
106+  -mabi=ilp32f \ 
107+  -mtune=arc-v-rhx-100-series \ 
108+  -specs=picolibcpp.specs \ 
109+  --crt0=semihost \ 
110+  --oslib=semihost \ 
111+  -Wl,--defsym=__flash_size=2M \ 
112+  -Wl,--defsym=__ram_size=2M \ 
113+  example.c -o example.elf 
114+ ``` 
115+ 
87116## Choosing a ` crt0 `  variant  
88117
89118A variant of a startup file (` crt0.o ` ) is chosen through ` --crt0= `  option. See a list of all supported values for this option below.
                         You can’t perform that action at this time. 
           
                  
0 commit comments