SHA256
1
0
forked from jengelh/SDL2
SDL2/sdl2-symvers.patch

45 lines
1.9 KiB
Diff

From: Jan Engelhardt <jengelh@inai.de>
Date: 2018-01-10 23:56:12.245827883 +0100
Should-this-be-upstream: yes
Is-it-upstream: not submitted yet
Functions were added over time, but neither was the SONAME changed
nor was a symvers file made. As a result, rpm is unable to
prevent a too-modern program being ran against a too-old SDL library.
It's bad user experience when symbols are resolved lazily, as the
program may crash.
---
Makefile.in | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Index: SDL2-2.0.22/Makefile.in
===================================================================
--- SDL2-2.0.22.orig/Makefile.in
+++ SDL2-2.0.22/Makefile.in
@@ -134,7 +134,7 @@ LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
-LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -Wl,--version-script=sdl2.sym
all: $(srcdir)/configure Makefile $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
@@ -155,7 +155,7 @@ update-revision:
.PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
-$(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS)
+$(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS) sdl2.sym
$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=$(LIBTOOLLINKERTAG) --mode=link $(LINKER) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
@@ -257,3 +257,6 @@ dist $(distfile):
rpm: $(distfile)
rpmbuild -ta $?
+
+sdl2.sym:
+ echo 'V_${PACKAGE_VERSION} { global: *; };' >$@