path: root/com32
diff options
authorMatt Fleming <matt.fleming@linux.intel.com>2011-04-26 10:02:13 +0100
committerMatt Fleming <matt.fleming@linux.intel.com>2011-04-26 10:05:38 +0100
commit10bbdc271f2c8457748d01efb466e881dd1c361e (patch)
tree843139a5c0c10fb0b42fd4765fa9b31d66281a73 /com32
parent5af736cf7677485da73bdc7ea4633960c8640cb6 (diff)
elflink: ldlinux should not have any dependencies
ldlinux currently requires the get_key() symbol, which means it has a dependency on libutil_com.c32. ldlinux.c32 really should be a standalone module so let's move get_key.c into ldlinux/. However, moving get_key.c creates a new problem - native linux applications such as com32/samples/keytest.c require the get_key() symbol which is currently exported by libutil_lnx.a. To fix this, we create a new native linux library that exports any required symbols from ldlinux. With this change we need to update com32/Makefile so that we build com32/elfink/ldlinux before com32/samples, and seeing as ldlinux now has no dependencies, we may as well move it to the front of $SUBDIRS. Also, update elf_gen_dep.sh to skip ldlinux.c32 and not search for dependencies for any of its unresolved symbols. This way, if anyone inadvertently introduces a dependency that cannot be resolved by the core, ldlinux.c32 will fail to load at runtime (which guarantees that the newly introduced dependency won't go unnoticed). Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
Diffstat (limited to 'com32')
-rw-r--r--com32/elflink/ldlinux/get_key.c (renamed from com32/libutil/get_key.c)0
4 files changed, 11 insertions, 6 deletions
diff --git a/com32/Makefile b/com32/Makefile
index 0ded5c41..debfe473 100644
--- a/com32/Makefile
+++ b/com32/Makefile
@@ -1,5 +1,4 @@
-SUBDIRS = libupload tools lib gpllib libutil modules mboot menu samples elflink rosh cmenu \
- hdt gfxboot sysdump lua/src elflink/ldlinux
+SUBDIRS = elflink/ldlinux libupload tools lib gpllib libutil modules mboot menu samples \
+ elflink rosh cmenu hdt gfxboot sysdump lua/src
all tidy dist clean spotless install:
set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
diff --git a/com32/elflink/ldlinux/Makefile b/com32/elflink/ldlinux/Makefile
index 8fe4d71d..318b3ac4 100644
--- a/com32/elflink/ldlinux/Makefile
+++ b/com32/elflink/ldlinux/Makefile
@@ -16,12 +16,18 @@ include $(MAKEDIR)/elf.mk
CFLAGS += -I$(topdir)/core/elflink -I$(topdir)/core/include
-all: ldlinux.c32
+all: ldlinux.c32 ldlinux_lnx.a
ldlinux.c32 : ldlinux.o cli.o readconfig.o refstr.o colors.o getadv.o \
- adv.o ipappend.o execute.o kernel.o
+ adv.o ipappend.o execute.o kernel.o get_key.o
$(LD) $(LDFLAGS) -o $@ $^
+LNXLIBOBJS = get_key.lo
+ldlinux_lnx.a: $(LNXLIBOBJS)
+ rm -f $@
+ $(AR) cq $@ $(LNXLIBOBJS)
+ $(RANLIB) $@
tidy dist:
rm -f *.o *.lo *.a *.lst .*.d
diff --git a/com32/libutil/get_key.c b/com32/elflink/ldlinux/get_key.c
index f277b43b..f277b43b 100644
--- a/com32/libutil/get_key.c
+++ b/com32/elflink/ldlinux/get_key.c
diff --git a/com32/libutil/Makefile b/com32/libutil/Makefile
index 5199253f..13fb4193 100644
--- a/com32/libutil/Makefile
+++ b/com32/libutil/Makefile
@@ -33,7 +33,7 @@ topdir = ../..
MAKEDIR = $(topdir)/mk
include $(MAKEDIR)/elf.mk
-LIBOBJS = ansiline.o ansiraw.o get_key.o keyname.o \
+LIBOBJS = ansiline.o ansiraw.o keyname.o \
sha1hash.o unbase64.o \
md5.o crypt-md5.o sha256crypt.o sha512crypt.o base64.o \