rbutil: Rename libbzip2.a to libbz2.a.

When cross compiling for Windows (at least mxe) links bz2, causing both
our copy and the system one getting linked, resulting in symbol clashes.
Make sure we use the same name as the system one, so the linker can pick
one of both.

Change-Id: I16213a20f48d4e192cd0b756931f9ccb449fd1c0
This commit is contained in:
Dominik Riebeling 2020-10-21 22:17:11 +02:00
parent 02c5dd3641
commit 1e12990ba9
4 changed files with 10 additions and 11 deletions

View file

@ -12,6 +12,6 @@ LIBSOURCES := bspatch.c
SOURCES := main.c SOURCES := main.c
OUTPUT := bspatch OUTPUT := bspatch
EXTRADEPS := libbzip2.a EXTRADEPS := libbz2.a
include ../libtools.make include ../libtools.make

View file

@ -10,6 +10,6 @@
LIBSOURCES := blocksort.c compress.c decompress.c randtable.c \ LIBSOURCES := blocksort.c compress.c decompress.c randtable.c \
bzlib.c crctable.c huffman.c bzlib.c crctable.c huffman.c
OUTPUT := bzip2 OUTPUT := bz2
include ../libtools.make include ../libtools.make

View file

@ -34,7 +34,7 @@ export CXX=$(EXTRALIBS_CXX)
export AR=$(EXTRALIBS_AR) export AR=$(EXTRALIBS_AR)
export ISYSROOT=$(EXTRALIB_ISYSROOT) export ISYSROOT=$(EXTRALIB_ISYSROOT)
libs: librbspeex libucl libipodpatcher libsansapatcher libmkamsboot libmktccboot libmkmpioboot libchinachippatcher libmkimxboot libmks5lboot libbzip2 libbspatch librbtomcrypt libs: librbspeex libucl libipodpatcher libsansapatcher libmkamsboot libmktccboot libmkmpioboot libchinachippatcher libmkimxboot libmks5lboot libbspatch libbz2 librbtomcrypt
# To support cross compiles, we explicitly pass the CC flag below for # To support cross compiles, we explicitly pass the CC flag below for
# all tools which override CC or CXX in their makefiles. CXX is only # all tools which override CC or CXX in their makefiles. CXX is only
@ -72,8 +72,8 @@ libmkimxboot:
libmks5lboot: libmks5lboot:
$(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mks5lboot BUILD_DIR=$(BUILD_DIR)/mks5lboot libmks5lboot.a CC=$(CC) $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mks5lboot BUILD_DIR=$(BUILD_DIR)/mks5lboot libmks5lboot.a CC=$(CC)
libbzip2: libbz2:
$(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/bzip2 BUILD_DIR=$(BUILD_DIR)/bzip2 libbzip2.a CC=$(CC) $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/bzip2 BUILD_DIR=$(BUILD_DIR)/bzip2 libbz2.a CC=$(CC)
libbspatch: libbspatch:
$(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/bspatch BUILD_DIR=$(BUILD_DIR)/bspatch libbspatch.a CC=$(CC) $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/bspatch BUILD_DIR=$(BUILD_DIR)/bspatch libbspatch.a CC=$(CC)

View file

@ -93,12 +93,11 @@ extralibs.commands = $$SILENT \
RBLIBS = rbspeex ipodpatcher sansapatcher mkamsboot mktccboot \ RBLIBS = rbspeex ipodpatcher sansapatcher mkamsboot mktccboot \
mkmpioboot chinachippatcher mkimxboot mks5lboot bspatch ucl \ mkmpioboot chinachippatcher mkimxboot mks5lboot bspatch ucl \
rbtomcrypt rbtomcrypt
# NOTE: Linking bzip2 causes problems on Windows (Qt seems to export those # NOTE: Our copy of libbzip2 has to use the name "bz2" to match up with the
# symbols as well, similar to what we have with zlib.) Only link that on # distro name. Otherwise cross compiling would end up linking two copies of
# non-Windows for now. # bzip2 using different names, causing symbol clashes. Using the same name
!win32 { # makes the compiler pick the one he likes.
RBLIBS += bzip2 RBLIBS += bz2
}
!win32-msvc* { !win32-msvc* {
QMAKE_EXTRA_TARGETS += extralibs QMAKE_EXTRA_TARGETS += extralibs
PRE_TARGETDEPS += extralibs PRE_TARGETDEPS += extralibs