diff options
Diffstat (limited to 'proton-sanitize_makefile.patch')
-rw-r--r-- | proton-sanitize_makefile.patch | 240 |
1 files changed, 240 insertions, 0 deletions
diff --git a/proton-sanitize_makefile.patch b/proton-sanitize_makefile.patch new file mode 100644 index 000000000000..e63b6912bef1 --- /dev/null +++ b/proton-sanitize_makefile.patch @@ -0,0 +1,240 @@ +diff --git a/build/makefile_base.mak b/build/makefile_base.mak +index d978a99..9502e3c 100644 +--- a/build/makefile_base.mak ++++ b/build/makefile_base.mak +@@ -63,7 +63,6 @@ ifeq ($(ENABLE_CCACHE),1) + export CCACHE_DIR := $(if $(CCACHE_DIR),$(CCACHE_DIR),$(HOME)/.ccache) + DOCKER_OPTS := -v $(CCACHE_DIR):$(CCACHE_DIR)$(CONTAINER_MOUNT_OPTS) $(CCACHE_ENV) -e CCACHE_DIR=$(CCACHE_DIR) $(DOCKER_OPTS) + else +- export CCACHE_DISABLE := 1 + DOCKER_OPTS := $(CCACHE_ENV) -e CCACHE_DISABLE=1 $(DOCKER_OPTS) + endif + +@@ -171,7 +170,8 @@ else + endif + + CROSSLDFLAGS += -Wl,--file-alignment,4096 +-OPTIMIZE_FLAGS := -O2 -march=nocona -mtune=core-avx2 -mfpmath=sse ++CFLAGS ?= -O2 -march=nocona -mtune=core-avx2 ++OPTIMIZE_FLAGS := $(CFLAGS) -mfpmath=sse + SANITY_FLAGS := -fwrapv -fno-strict-aliasing + DEBUG_FLAGS := -gdwarf-2 -gstrict-dwarf + COMMON_FLAGS = $(DEBUG_FLAGS) $(OPTIMIZE_FLAGS) $(SANITY_FLAGS) -ffile-prefix-map=$(CCACHE_BASEDIR)=. +@@ -354,8 +354,8 @@ ALL_TARGETS += dist + GOAL_TARGETS += dist + + dist_prefix: wine gst_good +- find $(DST_LIBDIR32)/wine -type f -execdir chmod a-w '{}' '+' +- find $(DST_LIBDIR64)/wine -type f -execdir chmod a-w '{}' '+' ++ find $(DST_LIBDIR32)/wine -type f -execdir chmod go-w '{}' '+' ++ find $(DST_LIBDIR64)/wine -type f -execdir chmod go-w '{}' '+' + rm -rf $(abspath $(DIST_PREFIX)) + python3 $(SRCDIR)/default_pfx.py $(abspath $(DIST_PREFIX)) $(abspath $(DST_DIR)) $(STEAM_RUNTIME_RUNSH) + +@@ -411,6 +411,9 @@ endif # ifeq ($(CONTAINER),) + ## + + GST_COMMON_MESON_ARGS := \ ++ -Db_lto=true \ ++ -Db_pie=true \ ++ -Ddoc=disabled \ + -Dexamples=disabled \ + -Dtests=disabled \ + -Dgtk_doc=disabled \ +@@ -423,6 +426,7 @@ GST_COMMON_MESON_ARGS := \ + + GST_ORC_MESON_ARGS := \ + -Dorc-test=disabled \ ++ -Dpackage-name="GStreamer Orc (Proton)" \ + $(GST_COMMON_MESON_ARGS) + + $(eval $(call rules-source,gst_orc,$(SRCDIR)/gst-orc)) +@@ -439,6 +443,9 @@ GSTREAMER_MESON_ARGS := \ + -Dbenchmarks=disabled \ + -Dtools=disabled \ + -Dbash-completion=disabled \ ++ -Dptp-helper-permissions=capabilities \ ++ -Ddbghelp=disabled \ ++ -Dpackage-name="GStreamer (Proton)" \ + $(GST_COMMON_MESON_ARGS) + + GSTREAMER_DEPENDS = gst_orc +@@ -477,6 +484,7 @@ GST_BASE_MESON_ARGS := \ + -Dxshm=disabled \ + -Dxvideo=disabled \ + -Dtools=disabled \ ++ -Dpackage-name="GStreamer Base Plugins (Proton)" \ + $(GST_COMMON_MESON_ARGS) + + GST_BASE_DEPENDS = gst_orc gstreamer +@@ -538,6 +546,7 @@ GST_GOOD_MESON_ARGS := \ + -Dximagesrc=disabled \ + -Dy4m=disabled \ + -Dtools=disabled \ ++ -Dpackage-name="GStreamer Good Plugins (Proton)" \ + $(GST_COMMON_MESON_ARGS) + + GST_GOOD_DEPENDS = gst_orc gstreamer gst_base +@@ -658,8 +667,14 @@ WINE_SOURCE_ARGS = \ + --exclude include/config.h.in \ + + WINE_CONFIGURE_ARGS = \ ++ --with-x \ ++ --with-gstreamer \ ++ --with-faudio \ + --with-mingw \ + --without-xpresent \ ++ --without-vkd3d \ ++ --without-oss \ ++ --disable-win16 \ + --disable-tests + + WINE_CONFIGURE_ARGS64 = --enable-win64 +@@ -778,7 +793,7 @@ VKD3D_PROTON_SOURCE_ARGS = \ + --exclude vkd3d_build.h.in \ + --exclude vkd3d_version.h.in \ + +-VKD3D_PROTON_MESON_ARGS = -Denable_standalone_d3d12=true ++VKD3D_PROTON_MESON_ARGS = -Denable_d3d12=true + VKD3D_PROTON_MESON_ARGS32 = \ + --bindir=$(VKD3D_PROTON_DST32)/lib/wine/vkd3d-proton \ + --cross-file=$(VKD3D_PROTON_OBJ32)/build-win32.txt +diff --git a/make/rules-autoconf.mk b/make/rules-autoconf.mk +index 80eee67..ed255e1 100644 +--- a/make/rules-autoconf.mk ++++ b/make/rules-autoconf.mk +@@ -16,8 +16,8 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/configure.ac + --prefix="$$($(2)_DST$(3))" \ + --libdir="$$($(2)_DST$(3))/lib$(subst 32,,$(3))" \ + $$($(2)_ENV$(3)) \ +- CROSSCFLAGS="$$(COMMON_FLAGS)" \ +- CROSSCXXFLAGS="$$(COMMON_FLAGS) -std=c++17" \ ++ CROSSCFLAGS="$$(COMMON_FLAGS) -fno-builtin-sin -fno-builtin-sinf -fno-builtin-cos -fno-builtin-cosf" \ ++ CROSSCXXFLAGS="$$(COMMON_FLAGS) -fno-builtin-sin -fno-builtin-sinf -fno-builtin-cos -fno-builtin-cosf -std=c++17" \ + CROSSLDFLAGS="$$(CROSSLDFLAGS)" \ + $$($(2)_CONFIGURE_ARGS) \ + $$($(2)_CONFIGURE_ARGS$(3)) +@@ -27,9 +27,9 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/configure.ac + $$(OBJ)/.$(1)-build$(3): + @echo ":: building $(3)bit $(1)..." >&2 + cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ +- $$(MAKE) ++ $$(MAKE) -j$$(SUBJOBS) + cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ +- $$(MAKE) install ++ $$(MAKE) -j$$(SUBJOBS) install + touch $$@ + endif + endef +diff --git a/make/rules-cargo.mk b/make/rules-cargo.mk +index 5369fb4..21db917 100644 +--- a/make/rules-cargo.mk ++++ b/make/rules-cargo.mk +@@ -14,7 +14,9 @@ $(OBJ)/.$(1)-configure$(3): + $(OBJ)/.$(1)-build$(3): + @echo ":: building $(3)bit $(1)..." >&2 + cd $$($(2)_SRC) && env $$($(2)_ENV$(3)) \ +- cargo build --target "$$(ARCH$(3))-unknown-linux-gnu" --target-dir $$($(2)_OBJ$(3)) $$(CARGO_BUILD_ARG) ++ cargo update --offline --verbose ++ cd $$($(2)_SRC) && env $$($(2)_ENV$(3)) \ ++ cargo build --locked --offline --verbose --target "$$(ARCH$(3))-unknown-linux-gnu" --target-dir $$($(2)_OBJ$(3)) $$(CARGO_BUILD_ARG) + touch $$@ + endif + endef +diff --git a/make/rules-cmake.mk b/make/rules-cmake.mk +index 4c61951..3a31610 100644 +--- a/make/rules-cmake.mk ++++ b/make/rules-cmake.mk +@@ -15,7 +15,7 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/CMakeLists.txt + cmake "$$($(2)_SRC)" \ + -DCMAKE_INSTALL_PREFIX="$$($(2)_DST$(3))" \ + -DCMAKE_INSTALL_LIBDIR="lib$(subst 32,,$(3))" \ +- -DCMAKE_BUILD_TYPE=plain \ ++ -DCMAKE_BUILD_TYPE=Release \ + $$($(2)_CMAKE_ARGS) \ + $$($(2)_CMAKE_ARGS$(3)) + +@@ -24,9 +24,9 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/CMakeLists.txt + $$(OBJ)/.$(1)-build$(3): + @echo ":: building $(3)bit $(1)..." >&2 + cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ +- $$(MAKE) ++ $$(MAKE) -j$$(SUBJOBS) + cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ +- $$(MAKE) install ++ $$(MAKE) -j$$(SUBJOBS) install + touch $$@ + endif + endef +diff --git a/make/rules-common.mk b/make/rules-common.mk +index 916df8b..044f705 100644 +--- a/make/rules-common.mk ++++ b/make/rules-common.mk +@@ -109,17 +109,18 @@ CONTAINERGOALS := $(CONTAINERGOALS) $(filter $(1),$(MAKECMDGOALS)) + + $(2)_ENV$(3) = \ + CARGO_HOME=$$(OBJ)/.cargo \ +- CARGO_TARGET_$$(call toupper,$$(ARCH$(3))-unknown-linux-gnu)_LINKER="$$(ARCH$(3))-linux-gnu-gcc" \ ++ CARGO_TARGET_$$(call toupper,$$(ARCH$(3))-unknown-linux-gnu)_LINKER="gcc" \ ++ CARGO_TARGET_$$(call toupper,$$(ARCH$(3))-unknown-linux-gnu)_RUSTFLAGS="$$(RUSTFLAGS)" \ + CCACHE_BASEDIR="$$(CCACHE_BASEDIR)" \ + STRIP="$$(STRIP)" \ +- CC="$$(CCACHE_BIN) $$(ARCH$(3))-linux-gnu-gcc" \ +- CXX="$$(CCACHE_BIN) $$(ARCH$(3))-linux-gnu-g++" \ ++ CC="$$(CCACHE_BIN) gcc -m$(3)" \ ++ CXX="$$(CCACHE_BIN) g++ -m$(3)" \ + LD="$$(ARCH$(3))-linux-gnu-ld" \ +- PKG_CONFIG="$$(ARCH$(3))-linux-gnu-pkg-config" \ ++ PKG_CONFIG="$$(ARCH$(3))-pc-linux-gnu-pkg-config" \ + CROSSCC="$$(CCACHE_BIN) $$(ARCH$(3))-w64-mingw32-gcc" \ + CROSSCXX="$$(CCACHE_BIN) $$(ARCH$(3))-w64-mingw32-g++" \ + CROSSLD="$$(ARCH$(3))-w64-mingw32-ld" \ +- CROSSPKG_CONFIG="$$(ARCH$(3))-linux-gnu-pkg-config" \ ++ CROSSPKG_CONFIG="$$(ARCH$(3))-pc-linux-gnu-pkg-config" \ + PATH="$$(call list-join,:,$$(foreach d,$$($(2)_DEPS$(3)),$$($$(d)_BINDIR$(3))),,:):$$(SRC)/glslang/bin:$$$$PATH" \ + LD_LIBRARY_PATH="$$(call list-join,:,$$(foreach d,$$($(2)_DEPS$(3)),$$($$(d)_LIBDIR$(3))),,:)$$$$LD_LIBRARY_PATH" \ + PKG_CONFIG_PATH="$$(call list-join,:,$$(foreach d,$$($(2)_DEPS$(3)),$$($$(d)_LIBDIR$(3))/pkgconfig))" \ +diff --git a/make/rules-meson.mk b/make/rules-meson.mk +index 7b982fa..8e08128 100644 +--- a/make/rules-meson.mk ++++ b/make/rules-meson.mk +@@ -11,7 +11,7 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/meson.build + @echo ":: configuring $(3)bit $(1)..." >&2 + rm -rf "$$($(2)_OBJ$(3))/meson-private/coredata.dat" + +- grep -s -v -e c_args -e cpp_args -e link_args "$$($(2)_SRC)/build-win$(3).txt" | \ ++ grep -s -v -e c_args -e cpp_args "$$($(2)_SRC)/build-win$(3).txt" | \ + sed -e "s:\[properties\]:[properties]\nc_args = [$$(call list-quote,$$(COMMON_FLAGS))]:" \ + -e "s:\[properties\]:[properties]\ncpp_args = [$$(call list-quote,$$(COMMON_FLAGS))]:" \ + -e "s:\[properties\]:[properties]\nlink_args = [$$(call list-quote,$$(CROSSLDFLAGS))]:" \ +@@ -21,7 +21,7 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/meson.build + meson "$$($(2)_OBJ$(3))" "$$($(2)_SRC)" \ + --prefix="$$($(2)_DST$(3))" \ + --libdir="lib$(subst 32,,$(3))" \ +- --buildtype=plain \ ++ --buildtype=release \ + $$($(2)_MESON_ARGS) \ + $$($(2)_MESON_ARGS$(3)) \ + $$(MESON_STRIP_ARG) +@@ -31,7 +31,7 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/meson.build + $$(OBJ)/.$(1)-build$(3): + @echo ":: building $(3)bit $(1)..." >&2 + env $$($(2)_ENV$(3)) \ +- ninja $$(filter -j%,$$(MAKEFLAGS)) -C "$$($(2)_OBJ$(3))" install $(-v?) ++ ninja -j$$(SUBJOBS) -C "$$($(2)_OBJ$(3))" install $(-v?) + touch $$@ + endif + endef +diff --git a/make/rules-winemaker.mk b/make/rules-winemaker.mk +index 8a0f0ce..36a107c 100644 +--- a/make/rules-winemaker.mk ++++ b/make/rules-winemaker.mk +@@ -29,7 +29,7 @@ $(OBJ)/.$(1)-build$(3): + @echo ":: building $(3)bit $(1)..." >&2 + rsync -arx "$$($(2)_SRC)/" "$$($(2)_OBJ$(3))/" + env $$($(2)_ENV$(3)) \ +- $$(MAKE) -C "$$($(2)_OBJ$(3))" LIBRARIES="$$($(2)_LDFLAGS)" ++ $$(MAKE) -j$$(SUBJOBS) -C "$$($(2)_OBJ$(3))" LIBRARIES="$$($(2)_LDFLAGS)" + cd "$$($(2)_OBJ$(3))" && touch "$(basename $(4)).spec" && env $$($(2)_ENV$(3)) \ + winebuild --dll --fake-module -E "$(basename $(4)).spec" -o "$(4).fake" + mkdir -p $$($(2)_DST$(3))/lib$(subst 32,,$(3))/wine/fakedlls/ |