qemu

FORK: QEMU emulator
git clone https://git.neptards.moe/neptards/qemu.git
Log | Files | Refs | Submodules | LICENSE

Makefile.target (3598B)


      1 # i386 cross compile notes
      2 
      3 I386_SRC=$(SRC_PATH)/tests/tcg/i386
      4 
      5 # Set search path for all sources
      6 VPATH 		+= $(I386_SRC)
      7 
      8 config-cc.mak: Makefile
      9 	$(quiet-@)( \
     10           $(call cc-option,-fno-pie, CROSS_CC_HAS_I386_NOPIE)) 3> config-cc.mak
     11 
     12 -include config-cc.mak
     13 
     14 I386_SRCS=$(notdir $(wildcard $(I386_SRC)/*.c))
     15 ALL_X86_TESTS=$(I386_SRCS:.c=)
     16 SKIP_I386_TESTS=test-i386-ssse3 test-avx test-3dnow test-mmx
     17 X86_64_TESTS:=$(filter test-i386-bmi2 $(SKIP_I386_TESTS), $(ALL_X86_TESTS))
     18 
     19 test-i386-sse-exceptions: CFLAGS += -msse4.1 -mfpmath=sse
     20 run-test-i386-sse-exceptions: QEMU_OPTS += -cpu max
     21 run-plugin-test-i386-sse-exceptions-%: QEMU_OPTS += -cpu max
     22 
     23 test-i386-pcmpistri: CFLAGS += -msse4.2
     24 run-test-i386-pcmpistri: QEMU_OPTS += -cpu max
     25 run-plugin-test-i386-pcmpistri-%: QEMU_OPTS += -cpu max
     26 
     27 test-i386-bmi2: CFLAGS=-O2
     28 run-test-i386-bmi2: QEMU_OPTS += -cpu max
     29 run-plugin-test-i386-bmi2-%: QEMU_OPTS += -cpu max
     30 
     31 #
     32 # hello-i386 is a barebones app
     33 #
     34 hello-i386: CFLAGS+=-ffreestanding
     35 hello-i386: LDFLAGS+=-nostdlib
     36 
     37 # test-386 includes a couple of additional objects that need to be
     38 # linked together, we also need a no-pie capable compiler due to the
     39 # non-pic calls into 16-bit mode
     40 ifneq ($(CROSS_CC_HAS_I386_NOPIE),)
     41 test-i386: CFLAGS += -fno-pie
     42 
     43 test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S test-i386.h test-i386-shift.h test-i386-muldiv.h
     44 	$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_CFLAGS) -o $@ \
     45 	   $(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm
     46 else
     47 test-i386:
     48 	$(call skip-test, "BUILD of $@", "missing -no-pie compiler support")
     49 run-test-i386:
     50 	$(call skip-test, "RUN of test-i386", "not built")
     51 run-plugin-test-i386-with-%:
     52 	$(call skip-test, "RUN of test-i386 ($*)", "not built")
     53 endif
     54 
     55 ifeq ($(SPEED), slow)
     56 
     57 test-i386-fprem.ref: test-i386-fprem
     58 	$(call quiet-command, ./$< > $@,"GENREF","generating $@")
     59 
     60 run-test-i386-fprem: TIMEOUT=60
     61 run-test-i386-fprem: test-i386-fprem test-i386-fprem.ref
     62 	$(call run-test,test-i386-fprem, $(QEMU) $<)
     63 	$(call diff-out,test-i386-fprem, test-i386-fprem.ref)
     64 else
     65 SKIP_I386_TESTS+=test-i386-fprem
     66 endif
     67 
     68 # non-inline runs will trigger the duplicate instruction heuristics in libinsn.so
     69 run-plugin-%-with-libinsn.so:
     70 	$(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
     71 	       -plugin ../../plugin/libinsn.so$(COMMA)inline=on \
     72 	       -d plugin -D $*-with-libinsn.so.pout $*)
     73 
     74 # Update TESTS
     75 I386_TESTS:=$(filter-out $(SKIP_I386_TESTS), $(ALL_X86_TESTS))
     76 TESTS=$(MULTIARCH_TESTS) $(I386_TESTS)
     77 
     78 # On i386 and x86_64 Linux only supports 4k pages (large pages are a different hack)
     79 EXTRA_RUNS+=run-test-mmap-4096
     80 
     81 sha512-sse: CFLAGS=-msse4.1 -O3
     82 sha512-sse: sha512.c
     83 	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
     84 
     85 run-sha512-sse: QEMU_OPTS+=-cpu max
     86 run-plugin-sha512-sse-with-%: QEMU_OPTS+=-cpu max
     87 
     88 TESTS+=sha512-sse
     89 
     90 CLEANFILES += test-avx.h test-mmx.h test-3dnow.h
     91 test-3dnow.h: test-mmx.py x86.csv
     92 	$(PYTHON) $(I386_SRC)/test-mmx.py $(I386_SRC)/x86.csv $@ 3DNOW
     93 
     94 test-mmx.h: test-mmx.py x86.csv
     95 	$(PYTHON) $(I386_SRC)/test-mmx.py $(I386_SRC)/x86.csv $@ MMX SSE SSE2 SSE3 SSSE3
     96 
     97 test-avx.h: test-avx.py x86.csv
     98 	$(PYTHON) $(I386_SRC)/test-avx.py $(I386_SRC)/x86.csv $@
     99 
    100 test-3dnow: CFLAGS += -masm=intel -O -I.
    101 run-test-3dnow: QEMU_OPTS += -cpu max
    102 run-plugin-test-3dnow: QEMU_OPTS += -cpu max
    103 test-3dnow: test-3dnow.h
    104 
    105 test-mmx: CFLAGS += -masm=intel -O -I.
    106 run-test-mmx: QEMU_OPTS += -cpu max
    107 run-plugin-test-mmx: QEMU_OPTS += -cpu max
    108 test-mmx: test-mmx.h
    109 
    110 test-avx: CFLAGS += -mavx -masm=intel -O -I.
    111 run-test-avx: QEMU_OPTS += -cpu max
    112 run-plugin-test-avx: QEMU_OPTS += -cpu max
    113 test-avx: test-avx.h