On Oct 6, 2014, at 11:45 AM, Brainerd, Mike <[email protected]> wrote:

> I found a build error that will not let me build AppPkg.
>  

Mike,

/home/mbrainer/DS-5-Workspace/edk2/Build/AppPkg/DEBUG_ARMLINUXGCC/AARCH64/StdLib/LibC/Stdio/Stdio/OUTPUT/LibStdio.lib(vfprintf.obj):
 In function `__vfprintf_unlocked':
/home/mbrainer/DS-5-Workspace/edk2/StdLib/LibC/Stdio/vfwprintf.c:1186: 
undefined reference to `__trunctfdf2'
/home/mbrainer/DS-5-Workspace/edk2/StdLib/LibC/Stdio/vfwprintf.c:1186: 
undefined reference to `__trunctfdf2'
make: *** 
[/home/mbrainer/DS-5-Workspace/edk2/Build/AppPkg/DEBUG_ARMLINUXGCC/AARCH64/AppPkg/Applications/Main/Main/DEBUG/Main.dll]
 Error 1

This is the compiler emitting an intrinsic to do a floating point operation, 
and the CompilerIntrinsicsLib does not contain this intrinsic so you get a link 
failure. If you look at the code this is a cast of a long double to a double is 
what is causing the compiler to emit the intrinsic. If you disassemble 
vfprintf.obj you would see the assembly language calling the __truncfdf2 
function getting called. 

Different compilers, versions of the compilers, and optimization levels can 
change what intrinsics get emitted by a compiler. Historically we tried to 
avoid writing code that caused intrinsics to be emitted due to the fact that 
issues like this can just pop up. But for ARM there was less math support than 
for IA32 so we ended up adding the CompilerIntrinsicLib. The need to avoid 
intrinsics is the reason the BaseLib has 64-bit math functions, since they 
would cause intrinsics to be emitted for IA32. 

You could comment/#ifdef out the failing code to make progress. 

If some one decides the intrinsics are needed the llvm (clang) project has 
implementations of the intrinsics that have a BSD compatible license. 
http://compiler-rt.llvm.org

Thanks,

Andrew Fish


> Invocation:
>  
> ~/DS-5-Workspace/edk2$ build -v
> Build environment: Linux-3.13.0-36-generic-x86_64-with-Ubuntu-14.04-trusty
> Build start time: 14:31:56, Oct.03 2014
>  
>  
> Initialize build database started ...
>  
> Initialize table DataModel started ...
> Initialize build database ... DONE!
> WORKSPACE        = /home/mbrainer/DS-5-Workspace/edk2
> ECP_SOURCE       = /home/mbrainer/DS-5-Workspace/edk2/EdkCompatibilityPkg
> EDK_SOURCE       = /home/mbrainer/DS-5-Workspace/edk2/EdkCompatibilityPkg
> EFI_SOURCE       = /home/mbrainer/DS-5-Workspace/edk2/EdkCompatibilityPkg
> EDK_TOOLS_PATH   = /home/mbrainer/DS-5-Workspace/edk2/BaseTools
>  
>  
> Architecture(s)  = AARCH64
> Build target     = DEBUG
> Toolchain        = ARMLINUXGCC
>  
> Active Platform          = 
> /home/mbrainer/DS-5-Workspace/edk2/AppPkg/AppPkg.dsc
>  
> FLASH_DEFINITION =
>  
> Processing meta-data .Found forced library for arch=AARCH64
>   ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf [NULL1]
>  
> Using edk2 svn:16190
>  
> I captured the output in the attached file “errors_vfwprintf.txt”
> It looks to me to be a LINARO binutils error.
> Has anyone else seen this? Am I finding a true bug or setup wrong?
> Regards,
>  
> MICHAEL BRAINERD   <image004.png>
> Contractor | AMD Server
> 7171 Southwest Parkway, Austin, TX 78735 USA 
> O +(1) 512-602-3491
> <image003.png>   facebook  |  amd.com
>  
> ------------------------------------------------------------------------------
> Slashdot TV.  Videos for Nerds.  Stuff that Matters.
> http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk_______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to