Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build fail on Ubuntu 20.04.2][OvmfPkg] SecTdxHelper.c:751:26: error: ‘PhysicalEnd’ may be used uninitialized in this function [-Werror=maybe-uninitialized] #10840

Open
tenpoku1000 opened this issue Mar 11, 2025 · 1 comment

Comments

@tenpoku1000
Copy link

~/edk2$ build -a X64 -t GCC49 -p OvmfPkg/OvmfPkgX64.dsc

/home/tenpoku/edk2/OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelper.c: In function ‘TdxHelperProcessTdHob’:
/home/tenpoku/edk2/OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelper.c:751:26: error: ‘PhysicalEnd’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
751 | APsStackStartAddress = PhysicalEnd - APS_STACK_SIZE (CpusNum);
| ^
/home/tenpoku/edk2/OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelper.c:335:25: note: ‘PhysicalEnd’ was declared here
335 | EFI_PHYSICAL_ADDRESS PhysicalEnd;
| ^~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [GNUmakefile:305: /home/tenpoku/edk2/Build/OvmfX64/DEBUG_GCC49/X64/OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelperLib/OUTPUT/SecTdxHelper.obj] error 1

build.py...
: error 7000: Failed to execute command
make tbuild [/home/tenpoku/edk2/Build/OvmfX64/DEBUG_GCC49/X64/OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelperLib]

build.py...
: error F002: Failed to build module
/home/tenpoku/edk2/OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelperLib.inf [X64, GCC49, DEBUG]

  • Failed -
    Build end time: 15:59:29, Mar.11 2025
    Build total time: 00:00:17

/edk2$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1
20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)

@tenpoku1000
Copy link
Author

$ git show -s --format=%H
de13423

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant