view README.md @ 0:e90bb8bec611 default tip

init
author Ken Miyahira <e175733@ie.u-ryukyu.ac.jp>
date Fri, 25 Dec 2020 19:02:23 +0900
parents
children
line wrap: on
line source

# Singularity/CbC

Cross Compile で吐き出されたバイナリは 32bit OS でのみ動作確認

## CbC on GCC

cbc を gcc で compile できるようにするやつ

### Build & Usage

#### Build
```sh
$ singularity build --fakeroot cbc_gcc.sif cbc_gcc.def
```

#### Usage
```sh
$ singularity shell cbc_gcc.sif
$ gcc hello.cbc
$ ./a.out
hello, world!!
```

## CbC on GCC Cross Compiler

cbc を ARM バイナリで吐き出す

### Build & Usage

#### Build
```sh
$ singularity build --fakeroot cbc_gcc_cross.sif cbc_gcc_cross.def
```

#### Usage
```sh
$ singularity shell cbc_gcc_cross.sif
$ arm-linux-gnueabihf-gcc hello.cbc
$ file ./a.out
a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, not stripped
```

## CbC on LLVM

cbc を llvm/clang で compile できるようにするやつ、cross もできるよ

### Build & Usage

#### Build
```sh
$ singularity build --fakeroot cbc_llvm.sif cbc_llvm.def
```

#### Usage
```sh
$ singularity shell cbc_llvm.sif
$ clang hello.cbc
$ ./a.out
hello, world!!
```

#### Usage (Cross Compile)
```sh
$ singularity shell cbc_llvm.sif
$ clang hello.cbc --target=arm-linux-gnueabihf
$ file a.out
a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, not stripped
```