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

Fix compile error with gnu-efi 3.0.8 #6

Closed yizhao1 closed 6 years ago

yizhao1 commented 6 years ago

The commit 9485c65f6d28b71ff697849c1c8d47fd077ccd07 in gnu-efi 3.0.8 implements StrnCpy and StrnLen functions:

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().

This would cause a seloader build error:

| /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 of 'StrnCpy' | /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

Signed-off-by: Yi Zhao yi.zhao@windriver.com

yizhao1 commented 6 years ago

Can we update GNU_EFI_VERSION to 3.0.8 in Env.mk directly ?

jiazhang0 commented 6 years ago

@yizhao1 Updating GNU_EFI_VERSION cannot resolve this issue. But it is fine to change it.