We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hello,
While I am trying to execute a simple bubble sort program in c as provided as an example in the arm development studio IDE, I am facing 3 errors like as shown below: (Target and source must be capability)
/bubblesort.c:45:37: error: invalid target type 'uint32_t *' (aka 'unsigned int *') for __cheri_tocap: target must be a capability seq_t sequence = (__cheri_tocap seq_t)malloc(sizeof(uint32_t) * SEQ_LEN);
../bubblesort.c:57:33: error: invalid source type 'uint32_t *' (aka 'unsigned int *') for __cheri_fromcap: source must be a capability free((__cheri_fromcap void*)sequence);
/bubblesort.c:70:6: error: conflicting types for 'print'void print (seq_t __cheri_input sequence, int size) {
N.B: I am using LLVM 13.0.0 with Morello support.
ok so is this version correct? changed line 24 with $PROGRAM_NAME.elf after -o and in line 25 used $PROGRAM_NAME.elf as first argument instead of the second as shown below.
_
# COMPILATION SCRIPT # Script based on instructions from: # https://git.morello-project.org/morello/docs/-/blob/morello/release-1.6/standalone-baremetal-readme.rst # First argument = program name (must match basename of .c file) PROGRAM_NAME=$1 PWD=`pwd` TOOLCHAIN=/opt/llvm-project-releases-morello-baremetal-release-1.6 ################################################ # COMPILE PROGRAM #new technique $TOOLCHAIN/bin/clang -target aarch64-none-elf -march=morello -c $PROGRAM_NAME.c -o $PROGRAM_NAME.o -O3 -g $TOOLCHAIN/bin/clang -target aarch64-none-elf -o $PROGRAM_NAME.elf $PROGRAM_NAME.o -Wl,--image-base,0xe0000000 $TOOLCHAIN/bin/llvm-objcopy -O binary $PROGRAM_NAME.elf $PROGRAM_NAME # #