• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/bzip2/0001-build-objects-twice.patch
Peter KorsgaardPeter Korsgaard committed 298cd8eaa2103 Feb 2015
Raw file
Source viewDiff to previous
 
1
Build objects twice for shared and static libraries
2
​
3
The existing Makefile causes problems on MIPS because the same object
4
files (not compiled with -fPIC) are used in static and shared libraries.
5
MIPS will refuce to link non-pic objects in shared libraries.
6
We fix this problems by creating a new rule for the shared library
7
and build the shared objects as *.sho instead of *.o.
8
Then, we use these objects to create the shared library.
9
​
10
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
11
​
12
Index: bzip2-1.0.6/Makefile-libbz2_so
13
===================================================================
14
--- bzip2-1.0.6.orig/Makefile-libbz2_so
15
+++ bzip2-1.0.6/Makefile-libbz2_so
16
@@ -25,13 +25,13 @@ SHELL=/bin/sh
17
 CC=gcc
18
 override CFLAGS += -fpic -fPIC -Wall
19
 
20
-OBJS= blocksort.o  \
21
-      huffman.o    \
22
-      crctable.o   \
23
-      randtable.o  \
24
-      compress.o   \
25
-      decompress.o \
26
-      bzlib.o
27
+OBJS= blocksort.sho  \
28
+      huffman.sho    \
29
+      crctable.sho   \
30
+      randtable.sho  \
31
+      compress.sho   \
32
+      decompress.sho \
33
+      bzlib.sho
34
 
35
 all: $(OBJS)
36
    $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
37
@@ -45,17 +45,5 @@ install:
38
 clean: 
39
    rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared
40
 
41
-blocksort.o: blocksort.c
42
-   $(CC) $(CFLAGS) -c blocksort.c
43
-huffman.o: huffman.c
44
-   $(CC) $(CFLAGS) -c huffman.c
45
-crctable.o: crctable.c
46
-   $(CC) $(CFLAGS) -c crctable.c
47
-randtable.o: randtable.c
48
-   $(CC) $(CFLAGS) -c randtable.c
49
-compress.o: compress.c
50
-   $(CC) $(CFLAGS) -c compress.c
51
-decompress.o: decompress.c
52
-   $(CC) $(CFLAGS) -c decompress.c
53
-bzlib.o: bzlib.c
54
-   $(CC) $(CFLAGS) -c bzlib.c
55
+%.sho: %.c
56
+   $(CC) $(CFLAGS) -o $@ -c $<
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.