From 9caef88e3f5cc3c93b814f5c2679d4bfc8525617 Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Mon, 11 Nov 2024 04:47:33 +0100 Subject: [PATCH] enable stripping for a bunch of self-built dlls --- ExternalProjects/SDL2/CMakeLists.txt | 1 + LibretroBridge/Makefile | 2 +- blip_buf/Makefile | 2 +- encore/build_release.sh | 2 +- lynx/make/Makefile | 2 +- wonderswan/make/Makefile | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ExternalProjects/SDL2/CMakeLists.txt b/ExternalProjects/SDL2/CMakeLists.txt index 64e4f52754..31c50708af 100644 --- a/ExternalProjects/SDL2/CMakeLists.txt +++ b/ExternalProjects/SDL2/CMakeLists.txt @@ -135,6 +135,7 @@ set_target_properties(SDL2 PROPERTIES NO_SONAME ON OUTPUT_NAME "SDL2" ) +target_link_options(SDL2 PRIVATE -s) # Copy output to our dll folders # This requires a bit of magic (add_custom_command is not allowed for targets made with add_subdirectory) diff --git a/LibretroBridge/Makefile b/LibretroBridge/Makefile index d9d022bef9..d727f0b495 100644 --- a/LibretroBridge/Makefile +++ b/LibretroBridge/Makefile @@ -1,7 +1,7 @@ CXX = g++ CFLAGS = -Wall -Wextra -Wpedantic -std=c++11 -O3 -fPIC -fvisibility=hidden -fomit-frame-pointer -fno-exceptions -LFLAGS = -shared +LFLAGS = -shared -s SRCS = LibretroBridge.cpp diff --git a/blip_buf/Makefile b/blip_buf/Makefile index 56ee36b874..4b53064073 100644 --- a/blip_buf/Makefile +++ b/blip_buf/Makefile @@ -1,7 +1,7 @@ CC = gcc CFLAGS = -Wall -Wextra -O3 -LFLAGS = -shared +LFLAGS = -shared -s all: blip_buf diff --git a/encore/build_release.sh b/encore/build_release.sh index e1134efd93..fd05b6ab43 100755 --- a/encore/build_release.sh +++ b/encore/build_release.sh @@ -15,5 +15,5 @@ rm -rf build mkdir build cd build cmake ../encore -DCMAKE_BUILD_TYPE=Release -DENABLE_LTO=ON -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \ - -DCMAKE_C_FLAGS="-fuse-ld=lld" -DCMAKE_CXX_FLAGS="-fuse-ld=lld" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DENABLE_VULKAN=OFF -G Ninja + -DCMAKE_C_FLAGS="-fuse-ld=lld" -DCMAKE_CXX_FLAGS="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS="-s" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DENABLE_VULKAN=OFF -G Ninja ninja diff --git a/lynx/make/Makefile b/lynx/make/Makefile index a121f03690..3a8ab0430f 100644 --- a/lynx/make/Makefile +++ b/lynx/make/Makefile @@ -16,7 +16,7 @@ TARGET = bizlynx.dll LDFLAGS_32 = -static -static-libgcc -static-libstdc++ LDFLAGS_64 = -LDFLAGS = -shared $(LDFLAGS_$(ARCH)) $(CXXFLAGS) +LDFLAGS = -shared $(LDFLAGS_$(ARCH)) $(CXXFLAGS) -s DEST_64 = ../../Assets/dll DESTCOPY_64 = ../../output/dll diff --git a/wonderswan/make/Makefile b/wonderswan/make/Makefile index e1d11ca0cf..ee2b132e1f 100644 --- a/wonderswan/make/Makefile +++ b/wonderswan/make/Makefile @@ -20,7 +20,7 @@ endif LDFLAGS_32 = -static -static-libgcc -static-libstdc++ LDFLAGS_64 = -LDFLAGS = -shared $(LDFLAGS_$(ARCH)) $(CXXFLAGS) +LDFLAGS = -shared $(LDFLAGS_$(ARCH)) $(CXXFLAGS) -s DEST_64 = ../../Assets/dll DESTCOPY_64 = ../../output/dll