aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2010-06-18 13:27:31 +0800
committerFeng Tang <feng.tang@intel.com>2010-07-20 11:10:03 +0800
commit530a32ac347a466b15c05951afbf544bf972c38f (patch)
tree681c8f2488ef0dea208b398d7611b2049fbec2df
parent71d5d1ba646e676cf1faf394e0d54950e416fe1c (diff)
downloadsyslinux-530a32ac347a466b15c05951afbf544bf972c38f.tar.gz
syslinux-530a32ac347a466b15c05951afbf544bf972c38f.tar.xz
syslinux-530a32ac347a466b15c05951afbf544bf972c38f.zip
elflink: modify Makefile to solve the undefined symbol problem
* use --whole-archive to let extlinux.elf contain all the mini com32 lib * remove several tool funcs from com32/lib/Makefile which is now implemented in core
-rwxr-xr-xcom32/lib/Makefile6
-rw-r--r--core/Makefile5
2 files changed, 7 insertions, 4 deletions
diff --git a/com32/lib/Makefile b/com32/lib/Makefile
index 2c15b9d2..f803af68 100755
--- a/com32/lib/Makefile
+++ b/com32/lib/Makefile
@@ -106,6 +106,7 @@ LIBCONSOLE_OBJS = \
\
syslinux/serial.o
+ #sys/readdir.o getcwd.o chdir.o fdopendir.o
LIBOTHER_OBJS = \
atoi.o atol.o atoll.o calloc.o creat.o \
ctypes.o errno.o fgetc.o fgets.o fopen.o fprintf.o fputc.o \
@@ -117,7 +118,7 @@ LIBOTHER_OBJS = \
sprintf.o srand48.o sscanf.o strcasecmp.o strcat.o \
strchr.o strcmp.o strcpy.o strdup.o strerror.o strlen.o \
strnlen.o \
- strncasecmp.o strncat.o strncmp.o strncpy.o strndup.o \
+ strncat.o strncmp.o strncpy.o strndup.o \
stpcpy.o stpncpy.o \
strntoimax.o strntoumax.o strrchr.o strsep.o strspn.o strstr.o \
strtoimax.o strtok.o strtol.o strtoll.o strtoul.o strtoull.o \
@@ -129,7 +130,7 @@ LIBOTHER_OBJS = \
\
dprintf.o vdprintf.o \
\
- sys/readdir.o getcwd.o chdir.o fdopendir.o \
+ getcwd.o fdopendir.o \
\
libgcc/__ashldi3.o libgcc/__udivdi3.o \
libgcc/__negdi2.o libgcc/__ashrdi3.o libgcc/__lshrdi3.o \
@@ -164,6 +165,7 @@ MINLIBOBJS = \
$(LIBCONSOLE_OBJS) \
$(LIBLOAD_OBJS) \
$(LIBMODULE_OBJS) \
+ $(LIBZLIB_OBJS)
# $(LIBVESA_OBJS)
diff --git a/core/Makefile b/core/Makefile
index 9c78a000..684e0484 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -50,7 +50,8 @@ COBJ := $(patsubst %.c,%.o,$(CSRC))
SOBJ := $(patsubst %.S,%.o,$(SSRC))
LIB = libcom32.a
-LIBS = $(LIB) $(com32)/lib/libcom32min.a $(LIBGCC)
+LIBS = $(LIB) --whole-archive $(com32)/lib/libcom32min.a
+LIBDEP = $(filter-out -% %start%,$(LIBS))
LIBOBJS = $(COBJ) $(SOBJ)
NASMDEBUG = -g -F dwarf
@@ -88,7 +89,7 @@ kwdhash.gen: keywords genhash.pl
-DHEXDATE="$(HEXDATE)" \
-l $(@:.o=.lsr) -o $@ -MP -MD .$@.d $<
-%.elf: %.o $(LIBS) syslinux.ld
+%.elf: %.o $(LIBDEP) syslinux.ld
$(LD) $(LDFLAGS) -Bsymbolic -pie -E --hash-style=gnu -T syslinux.ld -M -o $@ $< \
--start-group $(LIBS) --end-group \
> $(@:.elf=.map)