~daniel-mehrmann/e2fsprogs/master

« back to all changes in this revision

Viewing changes to debian/patches/fix-ftbfs-undefined-symbols.patch

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2012-08-14 11:43:29 UTC
  • mfrom: (8.4.19 sid)
  • Revision ID: package-import@ubuntu.com-20120814114329-nbp87t8d1hqqncqh
Tags: 1.42.5-1ubuntu1
* Merge from Debian unstable, remainging changes:
  - debian/control.in: 
      Build-depend on gettext:any instead of on gettext for (cross-building)
      Drop build dependency on dc, which hasn't been needed for some time.
      Update maintainer field.
  - debian/rules:
      Block pkg-create-dbgsym from operating on this package.
      Build without dietlibc-dev, which is in universe 
  - debian/control:
      Regenerate with ./debian/rules debian/control
  - debian/patches/fix-ftbfs-undefined-symbols.patch:
      Add a patch from Sourceforge Issue 3554345, to fix linking order.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
commit d5aa6a82b37a0e78d8882601e6ad9da9d9dcb4da
 
2
Author: Theodore Ts'o <tytso@mit.edu>
 
3
Date:   Sat Aug 4 16:56:55 2012 -0400
 
4
 
 
5
    Put ELF_OTHER_LIBS in the right place for the linker
 
6
    
 
7
    Commit a7c17431b9 attempted to fix a problem where the system
 
8
    libraries might get used instead of local libraries for things like
 
9
    -lcom_err.  It tried to accomplish this by moving $(ELF_OTHER_LIBS) to
 
10
    before $(LDFLAGS).
 
11
    
 
12
    Unfortunately, this was the wrong fix; $(ELF_OTHER_LIBS) *MUST* be
 
13
    after the object files, or the linker might not pull in the necessary
 
14
    library and not include it into the DT_NEEDED section of the shared
 
15
    library.  The proper fix is to add a -L$(LIB) before $(LDFLAGS), and
 
16
    then remove the -L option from all of the ELF_OTHER_LIBS definitions
 
17
    in the library Makefiles.
 
18
    
 
19
    Addresses-Sourceforge-Bug: #3554345
 
20
    
 
21
    Cc: Olivier Blin <olivier.blin@softathome.com>
 
22
    Reported-by:  Mike Frysinger <vapier@gentoo.org>
 
23
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
 
24
 
 
25
diff --git a/lib/Makefile.elf-lib b/lib/Makefile.elf-lib
 
26
index c66281c..78479d3 100644
 
27
--- a/lib/Makefile.elf-lib
 
28
+++ b/lib/Makefile.elf-lib
 
29
@@ -24,8 +24,9 @@ image:                $(ELF_LIB)
 
30
 
 
31
 $(ELF_LIB): $(OBJS)
 
32
        $(E) "  GEN_ELF_SOLIB $(ELF_LIB)"
 
33
-       $(Q) (cd elfshared; $(CC) --shared -o $(ELF_LIB) $(ELF_OTHER_LIBS) \
 
34
-               $(LDFLAGS) -Wl,-soname,$(ELF_SONAME) $(OBJS))
 
35
+       $(Q) (cd elfshared; $(CC) --shared -o $(ELF_LIB) \
 
36
+               -L$(top_builddir)/../lib $(LDFLAGS) \
 
37
+               -Wl,-soname,$(ELF_SONAME) $(OBJS) $(ELF_OTHER_LIBS))
 
38
        $(Q) $(MV) elfshared/$(ELF_LIB) .
 
39
        $(Q) $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)
 
40
        $(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) \
 
41
diff --git a/lib/Makefile.solaris-lib b/lib/Makefile.solaris-lib
 
42
index 66f2b4c..5990be8 100644
 
43
--- a/lib/Makefile.solaris-lib
 
44
+++ b/lib/Makefile.solaris-lib
 
45
@@ -24,8 +24,9 @@ image:                $(ELF_LIB)
 
46
 
 
47
 $(ELF_LIB): $(OBJS)
 
48
        $(E) "  GEN_ELF_SOLIB $(ELF_LIB)"
 
49
-       $(Q) (cd elfshared; $(CC) --shared -o $(ELF_LIB) $(ELF_OTHER_LIBS) \
 
50
-               $(LDFLAGS) -Wl,-h,$(ELF_SONAME) $(OBJS))
 
51
+       $(Q) (cd elfshared; $(CC) --shared -o $(ELF_LIB) \
 
52
+               -L$(top_builddir)/../lib $(LDFLAGS) \
 
53
+               -Wl,-h,$(ELF_SONAME) $(OBJS) $(ELF_OTHER_LIBS))
 
54
        $(Q) $(MV) elfshared/$(ELF_LIB) .
 
55
        $(Q) $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)
 
56
        $(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) \
 
57
diff --git a/lib/blkid/Makefile.in b/lib/blkid/Makefile.in
 
58
index f23a137..0ec8564 100644
 
59
--- a/lib/blkid/Makefile.in
 
60
+++ b/lib/blkid/Makefile.in
 
61
@@ -36,7 +36,7 @@ ELF_SO_VERSION = 1
 
62
 ELF_IMAGE = libblkid
 
63
 ELF_MYDIR = blkid
 
64
 ELF_INSTALL_DIR = $(root_libdir)
 
65
-ELF_OTHER_LIBS = -L../.. -luuid
 
66
+ELF_OTHER_LIBS = -luuid
 
67
 
 
68
 BSDLIB_VERSION = 2.0
 
69
 BSDLIB_IMAGE = libblkid
 
70
diff --git a/lib/ext2fs/Makefile.in b/lib/ext2fs/Makefile.in
 
71
index 0d9ac21..fc196fb 100644
 
72
--- a/lib/ext2fs/Makefile.in
 
73
+++ b/lib/ext2fs/Makefile.in
 
74
@@ -180,7 +180,7 @@ ELF_SO_VERSION = 2
 
75
 ELF_IMAGE = libext2fs
 
76
 ELF_MYDIR = ext2fs
 
77
 ELF_INSTALL_DIR = $(root_libdir)
 
78
-ELF_OTHER_LIBS = -L../.. -lcom_err
 
79
+ELF_OTHER_LIBS = -lcom_err
 
80
 
 
81
 BSDLIB_VERSION = 2.1
 
82
 BSDLIB_IMAGE = libext2fs
 
83
diff --git a/lib/quota/Makefile.in b/lib/quota/Makefile.in
 
84
index 2851eac..720befd 100644
 
85
--- a/lib/quota/Makefile.in
 
86
+++ b/lib/quota/Makefile.in
 
87
@@ -31,7 +31,7 @@ LIBDIR= quota
 
88
 #ELF_IMAGE = libquota
 
89
 #ELF_MYDIR = quota
 
90
 #ELF_INSTALL_DIR = $(root_libdir)
 
91
-#ELF_OTHER_LIBS = -L../.. -lext2fs
 
92
+#ELF_OTHER_LIBS = -lext2fs
 
93
 
 
94
 #BSDLIB_VERSION = 1.0
 
95
 #BSDLIB_IMAGE = libquota
 
96
diff --git a/lib/ss/Makefile.in b/lib/ss/Makefile.in
 
97
index 19413cc..c396f2d 100644
 
98
--- a/lib/ss/Makefile.in
 
99
+++ b/lib/ss/Makefile.in
 
100
@@ -20,7 +20,7 @@ ELF_SO_VERSION = 2
 
101
 ELF_IMAGE = libss
 
102
 ELF_MYDIR = ss
 
103
 ELF_INSTALL_DIR = $(root_libdir)
 
104
-ELF_OTHER_LIBS = -L../.. -lcom_err $(DLOPEN_LIB)
 
105
+ELF_OTHER_LIBS = -lcom_err $(DLOPEN_LIB)
 
106
 
 
107
 BSDLIB_VERSION = 1.0
 
108
 BSDLIB_IMAGE = libss