RE: makedumpfile: undefined reference for lzma function during build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----Original Message-----
> Hi Prabhakar,
> 
> Thank you for reporting this.
> 
> -----Original Message-----
> > Hi All,
> >
> > While building makedumpfile for AARM64 Thunder X2, I am getting this error
> >
> > cc  -g -O2 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
> > -D_LARGEFILE64_SOURCE -DVERSION='"1.6.7"' -DRELEASE_DATE='"16 Jan
> > 2020"' -D__aarch64__   print_info.o dwarf_info.o elf_info.o
> > erase_info.o sadump_info.o cache.o tools.o arch/arm.o arch/arm64.o
> > arch/x86.o arch/x86_64.o arch/ia64.o arch/ppc64.o arch/s390x.o
> > arch/ppc.o arch/sparc64.o -rdynamic -o makedumpfile makedumpfile.c
> > -lpthread -static -ldw -lbz2 -ldl -lelf -lz  -lebl
> > erase_info.o: In function `process_eppic_file':
> > /home/prabhakar/MERGE/OPENSRC/APPL/makedumpfile-code/erase_info.c:2202:
> > warning: Using 'dlopen' in statically linked applications requires at
> > runtime the shared libraries from the glibc version used for linking
> > //usr/local/lib/libdw.a(lzma.o): In function `__libdw_unlzma':
> > /home/prabhakar/MERGE/OPENSRC/APPL/elfutils-0.177/libdwfl/gzip.c:233:
> > undefined reference to `lzma_auto_decoder'
> > /home/prabhakar/MERGE/OPENSRC/APPL/elfutils-0.177/libdwfl/gzip.c:248:
> > undefined reference to `lzma_end'
> > /home/prabhakar/MERGE/OPENSRC/APPL/elfutils-0.177/libdwfl/gzip.c:267:
> > undefined reference to `lzma_code'
> > /home/prabhakar/MERGE/OPENSRC/APPL/elfutils-0.177/libdwfl/gzip.c:277:
> > undefined reference to `lzma_end'
> > /home/prabhakar/MERGE/OPENSRC/APPL/elfutils-0.177/libdwfl/gzip.c:236:
> > undefined reference to `lzma_end'
> > /home/prabhakar/MERGE/OPENSRC/APPL/elfutils-0.177/libdwfl/gzip.c:277:
> > undefined reference to `lzma_end'
> > /home/prabhakar/MERGE/OPENSRC/APPL/elfutils-0.177/libdwfl/gzip.c:277:
> > undefined reference to `lzma_end'
> > collect2: error: ld returned 1 exit status
> > Makefile:100: recipe for target 'makedumpfile' failed
> >
> > Source code: https://git.code.sf.net/p/makedumpfile/code
> > Top commit e7301654029330bbf49693002fa72223f9b3fb36 (HEAD -> master,
> > tag: Released-1-6-7, origin/master, origin/HEAD)
> > Author: Kazuhito Hagio <k-hagio-ab@xxxxxxx>
> > Date:   Wed Jan 15 13:09:56 2020 -0500
> >
> >     [v1.6.7] Update version
> >
> >     Update makedumpfile to version 1.6.7.
> >
> >     Signed-off-by: Kazuhito Hagio <k-hagio-ab@xxxxxxx>
> >
> >
> > I googled and found
> > http://lists.infradead.org/pipermail/kexec/2017-May/018760.html i.e.
> > diff --git a/Makefile b/Makefile
> > index 388faf7..810a7a0 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -50,7 +50,7 @@ OBJ_PART=$(patsubst %.c,%.o,$(SRC_PART))
> >  SRC_ARCH = arch/arm.c arch/arm64.c arch/x86.c arch/x86_64.c
> > arch/ia64.c arch/ppc64.c arch/s390x.c arch/ppc.c arch/sparc64.c
> >  OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH))
> >
> > -LIBS = -ldw -lbz2 -ldl -lelf -lz
> > +LIBS = -ldw -lbz2 -ldl -lelf -lz -llzma
> >  ifneq ($(LINKTYPE), dynamic)
> >  LIBS := -static $(LIBS)
> >  endif
> >
> > After adding this change, no more build error.This change was required
> > for spac64. So do we need similar changes for AARM64 platform also.
> 
> I confirmed that it also occurred on x86_64 without LINKTYPE=dynamic.
> The -ldw with -static option seems to require -llzma, and makedumpfile
> doesn't use liblzma directly, so I will merge this:
> 
> diff --git a/Makefile b/Makefile
> index 868eea6..ebef867 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -52,7 +52,7 @@ OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH))
> 
>  LIBS = -ldw -lbz2 -ldl -lelf -lz
>  ifneq ($(LINKTYPE), dynamic)
> -LIBS := -static $(LIBS)
> +LIBS := -static $(LIBS) -llzma
>  endif
> 
>  ifeq ($(USELZO), on)

Merged this with another fix:
https://sourceforge.net/p/makedumpfile/code/ci/12250baa02584dc713cdb1a12fb366f643fdc8b3/

Thanks,
Kazu


_______________________________________________
kexec mailing list
kexec@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/kexec



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux