Skip to content

Commit

Permalink
runtime: get ready to preprocess the PowerPC assembly files
Browse files Browse the repository at this point in the history
Diab does not support preprocessed assembly, so emulate minimal
preprocessing using sed.
  • Loading branch information
xavierleroy committed Sep 10, 2024
1 parent 7bd609f commit 125c493
Show file tree
Hide file tree
Showing 23 changed files with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,23 @@ $(LIB): $(OBJS)
rm -f $(LIB)
$(ARCHIVER) $(LIB) $(OBJS)

%.o: %.s
$(CASMRUNTIME) -o $@ $^
ifeq ($(strip $(SYSTEM)),diab)

%.o: %.S
sed -e '/#include/d' -e 's|//|#|' $^ > $*.s
$(CASMRUNTIME) -o $@ $*.s && rm $*.s

else

%.o: %.S
$(CASMRUNTIME) -DMODEL_$(MODEL) -DABI_$(ABI) -DENDIANNESS_$(ENDIANNESS) -DSYS_$(SYSTEM) -o $@ $^

endif

# If no asm implementation available, compile the portable C implementation
# with CompCert. Since CompCert rejects the "__compcert_i64_" identifiers, the C
# implementation uses "i64_" identifiers, and we rename them in the
# generated assembly
# with CompCert. Since CompCert rejects the "__compcert_i64_"
# identifiers, the C implementation uses "i64_" identifiers, and we
# rename them in the generated assembly

%.o: c/%.c c/i64.h ../ccomp
../ccomp -O2 -S -o $*.s -I./c c/$*.c
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 125c493

Please sign in to comment.