Open startergo opened 1 year ago
Also found out by testing that the Clang build through Docker does not work on my machine whereas the XCODE5 build of the same code works. Maybe we can try building with GCC5 instead?
GCC5 build fails:
In file included from /home/edk2/edk2/RefindPlusPkg/filesystems/fsw_btrfs_zstd.h:48,
from /home/edk2/edk2/RefindPlusPkg/filesystems/fsw_btrfs.c:1597:
At top level:
/home/edk2/edk2/RefindPlusPkg/filesystems/zstd/huf_decompress.c:607:21: warning: 'always_inline' function might not be inlinable [-Wattributes]
607 | FORCE_INLINE size_t HUF_decodeStreamX4(BYTE *p, BIT_DStream_t *bitDPtr, BYTE *const pEnd, const HUF_DEltX4 *const dt, const U32 dtLog)
| ^~~~~~~~~~~~~~~~~~
/home/edk2/edk2/RefindPlusPkg/filesystems/zstd/huf_decompress.c:168:21: warning: 'always_inline' function might not be inlinable [-Wattributes]
168 | FORCE_INLINE size_t HUF_decodeStreamX2(BYTE *p, BIT_DStream_t *const bitDPtr, BYTE *const pEnd, const HUF_DEltX2 *const dt, const U32 dtLog)
| ^~~~~~~~~~~~~~~~~~
In file included from /home/edk2/edk2/RefindPlusPkg/filesystems/fsw_btrfs_zstd.h:47,
from /home/edk2/edk2/RefindPlusPkg/filesystems/fsw_btrfs.c:1597:
/home/edk2/edk2/RefindPlusPkg/filesystems/zstd/fse_decompress.c:171:21: warning: 'always_inline' function might not be inlinable [-Wattributes]
171 | FORCE_INLINE size_t FSE_decompress_usingDTable_generic(void *dst, size_t maxDstSize, const void *cSrc, size_t cSrcSize, const FSE_DTable *dt,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/edk2/edk2/RefindPlusPkg/filesystems/fsw_btrfs_zstd.h:46,
from /home/edk2/edk2/RefindPlusPkg/filesystems/fsw_btrfs.c:1597:
/home/edk2/edk2/RefindPlusPkg/filesystems/zstd/zstd_decompress.c:1152:8: warning: 'always_inline' function might not be inlinable [-Wattributes]
1152 | size_t ZSTD_execSequenceLong(BYTE *op, BYTE *const oend, seq_t sequence, const BYTE **litPtr, const BYTE *const litLimit, const BYTE *const base,
| ^~~~~~~~~~~~~~~~~~~~~
/home/edk2/edk2/RefindPlusPkg/filesystems/zstd/zstd_decompress.c:1034:20: warning: 'always_inline' function might not be inlinable [-Wattributes]
1034 | FORCE_INLINE seq_t ZSTD_decodeSequenceLong_generic(seqState_t *seqState, int const longOffsets) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/edk2/edk2/RefindPlusPkg/filesystems/zstd/zstd_decompress.c:878:8: warning: 'always_inline' function might not be inlinable [-Wattributes]
878 | size_t ZSTD_execSequence(BYTE *op, BYTE *const oend, seq_t sequence, const BYTE **litPtr, const BYTE *const litLimit, const BYTE *const base,
| ^~~~~~~~~~~~~~~~~
make: *** [GNUmakefile:487: /home/edk2/Build/RefindPlus/RELEASE_GCC5/X64/RefindPlusPkg/filesystems/btrfs/OUTPUT/fsw_btrfs.obj] Error 1
Waiting for thread ending...(9)
build.py...
: error 7000: Failed to execute command
make tbuild [/home/edk2/Build/RefindPlus/RELEASE_GCC5/X64/RefindPlusPkg/filesystems/btrfs]
build.py...
: error 7000: Failed to execute command
make tbuild [/home/edk2/Build/RefindPlus/RELEASE_GCC5/X64/RefindPlusPkg/RefindPlus]
build.py...
: error F002: Failed to build module
/home/edk2/edk2/RefindPlusPkg/filesystems/btrfs.inf [X64, GCC5, RELEASE]
- Failed -
Build end time: 09:50:19, Dec.28 2022
Build total time: 00:00:53
+ exit
I had similar error building rEFInd before, which I fixed here. Maybe something similar? https://github.com/startergo/docker-makepkg/blob/main/PKG/PKGBUILD#L150-L163
I removed the from the RefindPlusPkg.dsc :
#!/bin/bash -xe
mkdir -pm 1777 out ||
mkdir -p out
git clone --recursive https://github.com/startergo/RefindPlus RefindPlusPkg
docker pull xaionaro2/edk2-builder:RefindPlusUDK
# hacky fix for duplication error of lodepng_malloc and lodepng_free
sed -e 's/void[*] lodepng_refit_malloc/void* _dup_lodepng_refit_malloc/' \
-e 's/void lodepng_refit_free/void _dup_lodepng_refit_free/' \
-i-orig RefindPlusPkg/libeg/lodepng_xtra.c
docker run --rm \
-e CFLAGS=-Wno-error \
-e TOOLCHAIN=GCC5 \
-e BUILD_TARGET=RELEASE \
-e DSC_PATH=RefindPlusPkg/RefindPlusPkg.dsc \
-v "$PWD/RefindPlusPkg/:/home/edk2/edk2/RefindPlusPkg/" \
-v "$PWD/out:/home/edk2/Build" \
xaionaro2/edk2-builder:RefindPlusUDK
And this build works (GCC5 RELEASE version)
For the DEBUG there are errors with GCC5:
Have you considered running Github Actions with OSX VM? https://github.com/acidanthera/OpenCorePkg/actions/runs/3794949343/jobs/6453557125 https://github.com/actions/runner-images/blob/macOS-12/20221215.1/images/macos/macos-12-Readme.md Building with XCODE5 in OSX environment?
So now both CLANG38 DEBUG and RELEASE build without any patches, but the product does not work properly. It hangs on boot. Maybe try CLANG39 or later? GCC5 still hangs on btrfs driver build.
@startergo did you ever get this working?
@startergo did you ever get this working?
I believe it is working now. Is it not working for you? go to
/edk2-builder-docker/examples/github.com-dakanji-RefindPlus/
and run the build.sh
.
You might need to change BUILD_TARGET=RELEASE
to BUILD_TARGET=DEBUG
for the debug version.
With docker run --rm -e CFLAGS=-Wno-error -e TOOLCHAIN=CLANG38 -e BUILD_TARGET=DEBUG -e DSC_PATH=RefindPlusPkg/RefindPlusPkg.dsc -v "$PWD/RefindPlusPkg/:/home/edk2/edk2/RefindPlusPkg/" -v "$PWD/out:/home/edk2/Build" xaionaro2/edk2-builder:RefindPlusUDK
I am getting
Architecture(s) = X64
Build target = DEBUG
Toolchain = CLANG38
Active Platform = /home/edk2/edk2/RefindPlusPkg/RefindPlusPkg.dsc
FLASH_DEFINITION =
Processing meta-data . Library instances of module [/home/edk2/edk2/RefindPlusPkg/RefindPlus.inf] [X64]:
UefiApplicationEntryPoint : /home/edk2/edk2/MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
UefiBootServicesTableLib : /home/edk2/edk2/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
UefiLib : /home/edk2/edk2/MdePkg/Library/UefiLib/UefiLib.inf
MemoryAllocationLib : /home/edk2/edk2/MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf BaseMemoryLib : /home/edk2/edk2/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
BaseLib : /home/edk2/edk2/MdePkg/Library/BaseLib/BaseLib.inf
DevicePathLib : /home/edk2/edk2/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
DebugLib : /home/edk2/edk2/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf DxeServicesLib : /home/edk2/edk2/MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
DxeServicesTableLib : /home/edk2/edk2/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
HobLib : /home/edk2/edk2/MdePkg/Library/DxeHobLib/DxeHobLib.inf IoLib : /home/edk2/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
PerformanceLib : /home/edk2/edk2/MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
MemLogLib : /home/edk2/edk2/RefindPlusPkg/Library/MemLogLib/MemLogLib.inf OcConsoleLib : /home/edk2/edk2/OpenCorePkg/Library/OcConsoleLib/OcConsoleLib.inf
OcMiscLib : /home/edk2/edk2/OpenCorePkg/Library/OcMiscLib/OcMiscLib.inf
HandleParsingLib : /home/edk2/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf RP_ApfsLib : /home/edk2/edk2/RefindPlusPkg/Library/RP_ApfsLib/RP_ApfsLib.inf
NvmExpressLib : /home/edk2/edk2/RefindPlusPkg/Library/NvmExpressLib/NvmExpressLib.inf OcUnicodeCollationEngGenericLib : /home/edk2/edk2/OpenCorePkg/Library/OcUnicodeCollationEngLib/OcUnicodeCollationEngGenericLib.inf
UefiRuntimeServicesTableLib : /home/edk2/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf PrintLib : /home/edk2/edk2/MdePkg/Library/BasePrintLib/BasePrintLib.inf
ReportStatusCodeLib : /home/edk2/edk2/MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
PcdLib : /home/edk2/edk2/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
OcDriverConnectionLib : /home/edk2/edk2/OpenCorePkg/Library/OcDriverConnectionLib/OcDriverConnectionLib.inf OcGuardLib : /home/edk2/edk2/OpenCorePkg/Library/OcGuardLib/OcGuardLib.inf
FileHandleLib : /home/edk2/edk2/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf HiiLib : /home/edk2/edk2/MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
SortLib : /home/edk2/edk2/MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf PeCoffGetEntryPointLib : /home/edk2/edk2/MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
UefiHiiServicesLib : /home/edk2/edk2/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
OcFileLib : /home/edk2/edk2/OpenCorePkg/Library/OcFileLib/OcFileLib.inf
OcStringLib : /home/edk2/edk2/OpenCorePkg/Library/OcStringLib/OcStringLib.inf
OcDevicePathLib : /home/edk2/edk2/OpenCorePkg/Library/OcDevicePathLib/OcDevicePathLib.inf
FrameBufferBltLib : /home/edk2/edk2/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf MtrrLib : /home/edk2/edk2/UefiCpuPkg/Library/MtrrLib/MtrrLib.inf
CpuLib : /home/edk2/edk2/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
PciLib : /home/edk2/edk2/MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf PciCf8Lib : /home/edk2/edk2/MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
build.py...
: error 0005: Could not create directory /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64
Which now I look at it is a different error to yours, so I'll open a new issue.
rEFInd builds with GCC5
#!/bin/bash -xe
mkdir -pm 1777 out ||
mkdir -p out
[[ -d RefindPkg ]] || git clone --recursive https://git.code.sf.net/p/refind/code RefindPkg
docker pull xaionaro2/edk2-builder:vUDK2018
# building DEBUG
exec docker run --rm \
-e CFLAGS=-Wno-error \
-e TOOLCHAIN=GCC5 \
-e BUILD_TARGET=DEBUG \
-e DSC_PATH=RefindPkg/RefindPkg.dsc \
-v "$PWD/RefindPkg/:/home/edk2/edk2/RefindPkg/" \
-v "$PWD/out:/home/edk2/Build" \
xaionaro2/edk2-builder:vUDK2018
# building RELEASE
exec docker run --rm \
-e CFLAGS=-Wno-error \
-e TOOLCHAIN=GCC5 \
-e BUILD_TARGET=RELEASE \
-e DSC_PATH=RefindPkg/RefindPkg.dsc \
-v "$PWD/RefindPkg/:/home/edk2/edk2/RefindPkg/" \
-v "$PWD/out:/home/edk2/Build" \
xaionaro2/edk2-builder:vUDK2018
cp -f /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.dll /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.debug
objcopy --strip-unneeded -R .eh_frame /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.dll
Waiting for thread ending...(1)
objcopy --add-gnu-debuglink=/home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.debug /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.dll
cp -f /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.debug /home/edk2/Build/Refind/DEBUG_GCC5/X64/refind.debug
Waiting for thread ending...(1)
"GenFw" -e UEFI_APPLICATION -o /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.efi /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.dll
cp -f /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.efi /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/OUTPUT
cp -f /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.efi /home/edk2/Build/Refind/DEBUG_GCC5/X64/refind.efi
cp -f /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/*.map /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/OUTPUT
- Done -
Build end time: 23:27:59, Aug.15 2024
Build total time: 00:00:50
For RefindPlus
both RELEASE and DEBUG build fine:
#!/bin/bash -xe
mkdir -pm 1777 out ||
mkdir -p out
git clone --recursive https://github.com/dakanji/RefindPlus RefindPlusPkg
docker pull xaionaro2/edk2-builder:RefindPlusUDK
# Release
exec docker run --rm \
-e CFLAGS=-Wno-error \
-e TOOLCHAIN=CLANG38 \
-e BUILD_TARGET=RELEASE \
-e DSC_PATH=RefindPlusPkg/RefindPlusPkg.dsc \
-v "$PWD/RefindPlusPkg/:/home/edk2/edk2/RefindPlusPkg/" \
-v "$PWD/out:/home/edk2/Build" \
xaionaro2/edk2-builder:RefindPlusUDK
# Debug
exec docker run --rm \
-e CFLAGS=-Wno-error \
-e TOOLCHAIN=CLANG38 \
-e BUILD_TARGET=DEBUG \
-e DSC_PATH=RefindPlusPkg/RefindPlusPkg.dsc \
-v "$PWD/RefindPlusPkg/:/home/edk2/edk2/RefindPlusPkg/" \
-v "$PWD/out:/home/edk2/Build" \
xaionaro2/edk2-builder:RefindPlusUDK
cp -f /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/DEBUG/RefindPlus.debug /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlus.debug
"GenFw" -e UEFI_APPLICATION -o /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/DEBUG/RefindPlus.efi /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/DEBUG/RefindPlus.dll
cp -f /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/DEBUG/RefindPlus.efi /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/OUTPUT
cp -f /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/DEBUG/RefindPlus.efi /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlus.efi
cp -f /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/DEBUG/*.map /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/OUTPUT
Failing at:
It looks like changing
VOID DebugLog
toextern VOID EFIAPI DebugLog
inglobal.h
should patch for now