bzip2: add linker option LDFLAGS
authorleo chung <gewalalb@gmail.com>
Wed, 16 Oct 2019 04:22:55 +0000 (12:22 +0800)
committerRISCi_ATOM <bob@bobcall.me>
Wed, 23 Oct 2019 15:35:36 +0000 (11:35 -0400)
if gcc not linker whith this LDFLAGS, "file libbz2.so.1.0.8" will
recognize as pie executable ELF file ( which should be shared object).

this because the file command version before 5.36 not recognize
correctly.

Signed-off-by: leo chung <gewalalb@gmail.com>
(cherry picked from commit 56ab58fb6ce29329963619d5a4fffa9d5828176e)

package/utils/bzip2/patches/021-fix-LDFLAGS.patch [new file with mode: 0644]

diff --git a/package/utils/bzip2/patches/021-fix-LDFLAGS.patch b/package/utils/bzip2/patches/021-fix-LDFLAGS.patch
new file mode 100644 (file)
index 0000000..7929d9a
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile-libbz2_so
++++ b/Makefile-libbz2_so
+@@ -35,7 +35,7 @@ OBJS= blocksort.o  \
+       bzlib.o
+ all: $(OBJS)
+-      $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS)
++      $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 $(LDFLAGS) -o libbz2.so.1.0.8 $(OBJS)
+       $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8
+       rm -f libbz2.so.1.0
+       ln -s libbz2.so.1.0.8 libbz2.so.1.0