All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] bzip2: Fix build system to build object files twice
@ 2013-06-05 14:57 Markos Chandras
  2013-06-05 18:57 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: Markos Chandras @ 2013-06-05 14:57 UTC (permalink / raw)
  To: buildroot

From: Markos Chandras <markos.chandras@imgtec.com>

Fixes build problems on MIPS

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
 package/bzip2/bzip2-build-objects-twice.patch | 56 +++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 package/bzip2/bzip2-build-objects-twice.patch

diff --git a/package/bzip2/bzip2-build-objects-twice.patch b/package/bzip2/bzip2-build-objects-twice.patch
new file mode 100644
index 0000000..9bde0f6
--- /dev/null
+++ b/package/bzip2/bzip2-build-objects-twice.patch
@@ -0,0 +1,56 @@
+Build objects twice for shared and static libraries
+
+The existing Makefile causes problems on MIPS because the same object
+files (not compiled with -fPIC) are used in static and shared libraries.
+MIPS will refuce to link non-pic objects in shared libraries.
+We fix this problems by creating a new rule for the shared library
+and build the shared objects as *.sho instead of *.o.
+Then, we use these objects to create the shared library.
+
+Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
+
+Index: bzip2-1.0.6/Makefile-libbz2_so
+===================================================================
+--- bzip2-1.0.6.orig/Makefile-libbz2_so
++++ bzip2-1.0.6/Makefile-libbz2_so
+@@ -25,13 +25,13 @@ SHELL=/bin/sh
+ CC=gcc
+ override CFLAGS += -fpic -fPIC -Wall
+ 
+-OBJS= blocksort.o  \
+-      huffman.o    \
+-      crctable.o   \
+-      randtable.o  \
+-      compress.o   \
+-      decompress.o \
+-      bzlib.o
++OBJS= blocksort.sho  \
++      huffman.sho    \
++      crctable.sho   \
++      randtable.sho  \
++      compress.sho   \
++      decompress.sho \
++      bzlib.sho
+ 
+ all: $(OBJS)
+ 	$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
+@@ -45,17 +45,5 @@ install:
+ clean: 
+ 	rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared
+ 
+-blocksort.o: blocksort.c
+-	$(CC) $(CFLAGS) -c blocksort.c
+-huffman.o: huffman.c
+-	$(CC) $(CFLAGS) -c huffman.c
+-crctable.o: crctable.c
+-	$(CC) $(CFLAGS) -c crctable.c
+-randtable.o: randtable.c
+-	$(CC) $(CFLAGS) -c randtable.c
+-compress.o: compress.c
+-	$(CC) $(CFLAGS) -c compress.c
+-decompress.o: decompress.c
+-	$(CC) $(CFLAGS) -c decompress.c
+-bzlib.o: bzlib.c
+-	$(CC) $(CFLAGS) -c bzlib.c
++%.sho: %.c
++	$(CC) $(CFLAGS) -o $@ -c $<
-- 
1.8.2.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH] bzip2: Fix build system to build object files twice
  2013-06-05 14:57 [Buildroot] [PATCH] bzip2: Fix build system to build object files twice Markos Chandras
@ 2013-06-05 18:57 ` Peter Korsgaard
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2013-06-05 18:57 UTC (permalink / raw)
  To: buildroot

>>>>> "Markos" == Markos Chandras <markos.chandras@gmail.com> writes:

 Markos> From: Markos Chandras <markos.chandras@imgtec.com>
 Markos> Fixes build problems on MIPS

 Markos> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-05 18:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-05 14:57 [Buildroot] [PATCH] bzip2: Fix build system to build object files twice Markos Chandras
2013-06-05 18:57 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.