X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile.libretro;h=1169d892ec5fcde4c07dfa64d8d3484f14594b4c;hb=025b6fde9b8ce688008227211168358b96e98d62;hp=453559844feb46e1f8ff7d176b784864c2ed11f6;hpb=25e658d16367cc4fea8ee930b7f32540e7fce875;p=pcsx_rearmed.git diff --git a/Makefile.libretro b/Makefile.libretro index 45355984..1169d892 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -24,6 +24,7 @@ endif CC ?= gcc CXX ?= g++ AS ?= as +LD ?= ld CFLAGS ?= # early compiler overrides @@ -74,6 +75,12 @@ else ifeq ($(platform), miyoo) endif CC_AS ?= $(CC) +# workaround wrong owner in libretro infra +GIT_VERSION1 := $(shell test -d /builds/libretro/pcsx_rearmed && git rev-parse --short HEAD 2>&1) +ifneq ($(findstring dubious ownership,$(GIT_VERSION1)),) +DUMMY := $(shell git config --global --add safe.directory /builds/libretro/pcsx_rearmed) +endif + TARGET_NAME := pcsx_rearmed ARCH_DETECTED := $(shell $(CC) $(CFLAGS) -dumpmachine | awk -F- '{print $$1}') GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" @@ -104,7 +111,7 @@ ifneq (,$(shell $(CC) -E -dD $(CFLAGS) include/arm_features.h | grep 'HAVE_NEON3 BUILTIN_GPU = neon endif endif -ifneq (,$(findstring $(ARCH_DETECTED),i686 x86_64 aarch64)) +ifneq (,$(filter $(ARCH_DETECTED),i686 x86_64 arm64 aarch64)) BUILTIN_GPU = neon endif @@ -123,25 +130,23 @@ endif else ifneq (,$(findstring CortexA73_G12B,$(platform))) TARGET := $(TARGET_NAME)_libretro.so fpic := -fPIC - SHARED := -shared -Wl,-version-script=link.T ARCH = arm64 BUILTIN_GPU = neon HAVE_NEON = 1 DYNAREC = ari64 CFLAGS += -fomit-frame-pointer -ffast-math -DARM - CPUFLAGS += -march=armv8-a+crc -mfpu=neon-fp-armv8 -mcpu=cortex-a73 -mtune=cortex-a73.cortex-a53 + CFLAGS += -march=armv8-a+crc -mcpu=cortex-a73 -mtune=cortex-a73.cortex-a53 # ALLWINNER H5 else ifneq (,$(findstring h5,$(platform))) TARGET := $(TARGET_NAME)_libretro.so fpic := -fPIC - SHARED := -shared -Wl,-version-script=link.T ARCH = arm64 BUILTIN_GPU = neon HAVE_NEON = 1 DYNAREC = ari64 CFLAGS += -fomit-frame-pointer -ffast-math -DARM - CPUFLAGS += -march=armv8-a+crc -mfpu=neon-fp-armv8 -mcpu=cortex-a53 -mtune=cortex-a53 + CFLAGS += -march=armv8-a+crc -mcpu=cortex-a53 -mtune=cortex-a53 else ifeq ($(platform), linux-portable) TARGET := $(TARGET_NAME)_libretro.so @@ -268,7 +273,7 @@ else ifeq ($(platform), psl1ght) NO_PTHREAD := 1 LIBPTHREAD := LIBDL := - DYNAREC := 0 # missing sysconf() + NEED_SYSCONF := 1 # PSP else ifeq ($(platform), psp1) @@ -330,10 +335,10 @@ else ifneq (,$(filter $(platform),ngc wii wiiu)) TARGET := $(TARGET_NAME)_libretro_$(platform).a ifeq ($(platform), ngc) CFLAGS += -DHW_DOL -mogc - DYNAREC := 0 # missing sysconf() + NEED_SYSCONF := 1 else ifeq ($(platform), wii) CFLAGS += -DHW_RVL -mrvl - DYNAREC := 0 # missing sysconf() + NEED_SYSCONF := 1 else ifeq ($(platform), wiiu) # -mwup was removed in newer devkitPPC versions CFLAGS += -DHW_WUP @@ -448,8 +453,7 @@ else ifeq ($(platform), classic_armv7_a7) TARGET := $(TARGET_NAME)_libretro.so fpic := -fPIC CFLAGS += -Ofast \ - -flto=4 -fwhole-program -fuse-linker-plugin \ - -fdata-sections -ffunction-sections -Wl,--gc-sections \ + -flto=auto -fuse-linker-plugin \ -fno-stack-protector -fno-ident -fomit-frame-pointer \ -falign-functions=1 -falign-jumps=1 -falign-loops=1 \ -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops \ @@ -479,7 +483,8 @@ else ifeq ($(platform), classic_armv8_a35) TARGET := $(TARGET_NAME)_libretro.so fpic := -fPIC CFLAGS += -Ofast \ - -fmerge-all-constants -fno-math-errno -march=armv8-a \ + -fmerge-all-constants -fno-math-errno \ + -fno-stack-protector -fomit-frame-pointer \ -marm -mcpu=cortex-a35 -mtune=cortex-a35 -mfpu=neon-fp-armv8 -mfloat-abi=hard HAVE_NEON = 1 HAVE_NEON_ASM = 1 @@ -529,7 +534,7 @@ else ifeq ($(platform), miyoo) TARGET := $(TARGET_NAME)_libretro.so fpic := -fPIC CFLAGS += -mcpu=arm926ej-s -fsingle-precision-constant - CFLAGS += -DGPULIB_USE_MMAP -DGPU_UNAI_USE_INT_DIV_MULTINV -D_MIYOO + CFLAGS += -DGPU_UNAI_USE_INT_DIV_MULTINV -D_MIYOO ARCH = arm BUILTIN_GPU = unai DYNAREC = ari64 @@ -539,8 +544,8 @@ else ifeq ($(platform), miyoo) else ifeq ($(platform), emscripten) TARGET := $(TARGET_NAME)_libretro_$(platform).bc fpic := -fPIC - SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T CFLAGS += -DNO_DYLIB + DYNAREC = STATIC_LINKING = 1 # Windows @@ -578,8 +583,14 @@ ifndef HAVE_NEON_ASM # asm for 32bit only HAVE_NEON_ASM = $(shell $(CC) -E -dD $(CFLAGS) include/arm_features.h | grep -q HAVE_NEON32 && echo 1 || echo 0) endif -ifeq ($(NO_UNDEF_CHECK)$(shell ld -v 2> /dev/null | awk '{print $$1}'),GNU) -MAIN_LDFLAGS += -Wl,--no-undefined +ifeq ($(NO_UNDEF_CHECK)$(shell $(LD) -v 2> /dev/null | awk '{print $$1}'),GNU) + ifeq (,$(findstring $(platform),win32)) + MAIN_LDFLAGS += -Wl,-version-script=frontend/link.T + endif + ifneq ($(STATIC_LINKING), 1) + CFLAGS += -ffunction-sections -fdata-sections + endif +MAIN_LDFLAGS += -Wl,--gc-sections -Wl,--no-undefined endif ifdef ALLOW_LIGHTREC_ON_ARM CFLAGS += -DALLOW_LIGHTREC_ON_ARM @@ -601,21 +612,12 @@ SOUND_DRIVERS = libretro PLUGINS = NO_CONFIG_MAK = yes -# what does this do -#libretro_all: all -#ifeq ($(platform),ios) -#ifeq ($(DYNAREC),1) -# make -f Makefile.libretro DYNAREC=0 platform=$(platform) clean -# make -f Makefile.libretro DYNAREC=0 platform=$(platform) -#endif -#endif - $(info TARGET: $(TARGET)) $(info platform: $(platform)) $(info ARCH: $(ARCH)) $(info DYNAREC: $(DYNAREC)) $(info BUILTIN_GPU: $(BUILTIN_GPU)) -$(info CC: $(CC)) +$(info CC: $(CC) : $(shell $(CC) --version | head -1)) $(info CFLAGS: $(CFLAGS)) $(info MAIN_LDLIBS: $(MAIN_LDLIBS)) $(info )