1) mklibs.patch
A patch that updates the current initrd-source/mklibs to the current version of mklibs. The update primarily fixes a problem where mklibs might create recursive symlinks when canonizing library names. This happens when you build on ia64/RHEL3.
2) libcom_err.so.3.patch
A patch that adds the /usr/kerberos/lib directory to the library path list passed to mklibs. On ia64/RHEL3, libcom_err.so.3 is in that directory, and consequently without this patch mklibs barfs because it can't find libcom_err.so.3.
With these fixes, "make srpm" and "make rpm" work just fine on ia64/RHEL3 and i386/FC2. I haven't tried on other arch/os combinations yet, but it probably works on most combos.
-- Josh Aas Linux System Software Silicon Graphics, Inc. (SGI)
Index: initrd_source/mklibs
===================================================================
RCS file: /cvsroot/systemimager/systemimager/initrd_source/mklibs,v
retrieving revision 1.1
diff -u -r1.1 mklibs
--- initrd_source/mklibs 8 Sep 2003 02:28:44 -0000 1.1
+++ initrd_source/mklibs 25 Dec 2004 18:47:52 -0000
@@ -143,7 +143,7 @@
# Num: Value Size Type Bind Vis Ndx Name
# 1: 000000012002ab48 168 FUNC GLOBAL DEFAULT UND [EMAIL PROTECTED] (2)
symline_regexp = \
- re.compile("\s*\d+: .+\s+\d+\s+\w+\s+(\w+)+\s+\w+\s+(\w+)\s+(\w+)")
+ re.compile("\s*\d+: .+\s+\d+\s+\w+\s+(\w+)+\s+\w+\s+(\w+)\s+([EMAIL
PROTECTED])")
# Return undefined symbols in an object as a Set of tuples (name, weakness)
def undefined_symbols(obj):
@@ -345,7 +345,6 @@
match = pattern.match(x)
if match:
ldlib = match.group(1)
- debug(DEBUG_NORMAL, "I: Using", ldlib, "as dynamic linker.")
break
if ldlib:
break
@@ -353,6 +352,8 @@
if not ldlib:
sys.exit("E: Dynamic linker not found, aborting.")
+debug(DEBUG_NORMAL, "I: Using", ldlib, "as dynamic linker.")
+
# Check for rpaths
for obj in objects.values():
rpath_val = rpath(obj)
@@ -546,7 +547,12 @@
# Canonicalize library names.
for lib in regexpfilter(os.listdir(dest_path), "(.*so[.\d]*)$").elems():
- soname = extract_soname(dest_path + "/" + lib)
+ this_lib_path = dest_path + "/" + lib
+ if os.path.islink(this_lib_path):
+ debug(DEBUG_VERBOSE, "Unlinking %s." % lib)
+ os.remove(this_lib_path)
+ continue
+ soname = extract_soname(this_lib_path)
if soname:
debug(DEBUG_VERBOSE, "Moving %s to %s." % (lib, soname))
os.rename(dest_path + "/" + lib, dest_path + "/" + soname)
@@ -555,7 +561,8 @@
ld_file = find_lib(ldlib)
ld_file_name = os.path.basename(ld_file)
-if not os.access(dest_path + "/" + lib, os.F_OK):
+if not os.access(dest_path + "/" + ld_file_name, os.F_OK):
+ debug(DEBUG_NORMAL, "I: stripping and copying dynamic linker.")
command(target + "objcopy", "--strip-unneeded -R .note -R .comment",
ld_file, dest_path + "/" + ld_file_name)
Index: Makefile
===================================================================
RCS file: /cvsroot/systemimager/systemimager/Makefile,v
retrieving revision 1.172
diff -u -r1.172 Makefile
--- Makefile 13 Dec 2004 18:15:57 -0000 1.172
+++ Makefile 24 Dec 2004 21:55:51 -0000
@@ -538,7 +538,7 @@
test ! -d /lib64 || cp -a /lib64/ld* $(BOEL_BINARIES_DIR)/lib64
endif
cd $(BOEL_BINARIES_DIR) \
- && $(PYTHON) $(TOPDIR)/initrd_source/mklibs -L
/lib64:/usr/lib64:$(SRC_DIR)/$(PARTED_DIR)/libparted/.libs:$(SRC_DIR)/$(DISCOVER_DIR)/lib/.libs
-v -d lib bin/* sbin/*
+ && $(PYTHON) $(TOPDIR)/initrd_source/mklibs -L
/lib64:/usr/lib64:$(SRC_DIR)/$(PARTED_DIR)/libparted/.libs:/usr/kerberos/lib:$(SRC_DIR)/$(DISCOVER_DIR)/lib/.libs
-v -d lib bin/* sbin/*
#
# Include other files required by openssh that apparently aren't
# picked up by mklibs for some reason. -BEF-
