ArmPlatformPkg: fix undefined reference to memcpy Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Scott Duplichan <sc...@notabs.org> ---
When building ArmJuno, (-flto -Os build only) fails with: ArmPlatformPkg\Library\PL031RealTimeClockLib/PL031RealTimeClockLib.c:224: undefined reference to `memcpy' Clearly STATIC was intended for the day of month lookup table so that the compiler doesn't have to generate code to create the table at runtime each time the function is entered. Apparently -flto triggers use of memcpy for creating the table. making the table static removes the need for the compiler to create it at runtime. Thanks, Scott --- Index: ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c =================================================================== --- ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c (revision 16323) +++ ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c (working copy) @@ -221,7 +221,7 @@ IN EFI_TIME *Time ) { - INTN DayOfMonth[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + STATIC INTN DayOfMonth[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; if (Time->Day < 1 || Time->Day > DayOfMonth[Time->Month - 1] || --- ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel