jiazhang0 / SELoader

Secure EFI Loader designed to authenticate the non-PE files
BSD 3-Clause "New" or "Revised" License
47 stars 22 forks source link

The SELoader built failed with gnu-efi 3.0.8: multiple definition of `StrnCpy' #5

Closed yizhao1 closed 6 years ago

yizhao1 commented 6 years ago

The SELoader built failed with gnu-efi 3.0.8:

| /build/tmp-glibc/work/core2-64-wrs-linux/seloader/0.4.5+gitAUTOINC+9c2723afae-r0/recipe-sysroot/usr/lib64/libefi.a(str.o): In function StrnCpy': | /usr/src/debug/gnu-efi/3.0.8-r0/gnu-efi-3.0.8//lib/str.c:124: multiple definition ofStrnCpy' | /build/tmp-glibc/work/core2-64-wrs-linux/seloader/0.4.5+gitAUTOINC+9c2723afae-r0/git/Src/Efi/Lib/BaseLibrary/libBaseLibrary.a(StrnCpy.o):StrnCpy.c:(.text+0x0): first defined here | /build/tmp-glibc/work/core2-64-wrs-linux/seloader/0.4.5+gitAUTOINC+9c2723afae-r0/git/Rules.mk:9: recipe for target 'SELoader.so' failed | make[2]: *** [SELoader.so] Error 1

This is because gnu-efi 3.0.8 also define StrnCpy function in the following commit:

commit 9485c65f6d28b71ff697849c1c8d47fd077ccd07 Author: Peter Jones pjones@redhat.com Date: Tue Mar 13 15:20:28 2018 -0400

gnu-efi: add some more common string functions.

This adds bounded string helper functions:

StrnLen()
StrnCpy()
StrnCat()
StpnCpy()

And the unbounded function StpCpy().

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
jiazhang0 commented 6 years ago

The commit https://github.com/jiazhang0/SELoader/commit/1a0b7d6649356c805ad8cee948c4707e8d1122e0 fixes this issue.