[arch-commits] Commit in syslinux/trunk (PKGBUILD prevent-pow-optimization.patch)

Anatol Pomozov anatolik at archlinux.org
Wed Mar 27 22:16:30 UTC 2019


    Date: Wednesday, March 27, 2019 @ 22:16:30
  Author: anatolik
Revision: 349301

upgpkg: syslinux 6.04.pre3.r3.g05ac953c-1

FS#59987: avoid compiler optimizations for pow()

Added:
  syslinux/trunk/prevent-pow-optimization.patch
Modified:
  syslinux/trunk/PKGBUILD

--------------------------------+
 PKGBUILD                       |   13 +++++++++----
 prevent-pow-optimization.patch |   36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-03-27 21:31:22 UTC (rev 349300)
+++ PKGBUILD	2019-03-27 22:16:30 UTC (rev 349301)
@@ -4,9 +4,9 @@
 # Contributor: Keshav Amburay <(the ddoott ridikulus ddoott rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
 
 pkgname=syslinux
-pkgver=6.04.pre1.r41.g5e426532
+pkgver=6.04.pre3.r3.g05ac953c
 #_tag=syslinux-$pkgver
-_commit=5e426532210bb830d2d7426eb8d8c154d9dfcba6
+_commit=05ac953c23f90b2328d393f7eecde96e41aed067
 pkgrel=1
 pkgdesc='Collection of boot loaders that boot from FAT, ext2/3/4 and btrfs filesystems, from CDs and via PXE'
 url='http://www.syslinux.org/'
@@ -32,14 +32,16 @@
 source=(git+https://repo.or.cz/syslinux.git#commit=$_commit
         syslinux.cfg
         syslinux-install_update
-	strip_note_section.patch
+        strip_note_section.patch
         single-load-segment.patch
+        prevent-pow-optimization.patch
 )
 sha1sums=('SKIP'
           '1145f454bd297d373ad123425f93620c3e92f585'
           'df5160a138ca8c6502d67fe1a64fec78b50e82c2'
           '11d928087764ca286af0327d40230f219348568c'
-          '830c88005fb6c9e759f67b91ab33a10b002385de')
+          '830c88005fb6c9e759f67b91ab33a10b002385de'
+          'c94622eaa14ad9512e4f43b13302ba35d1787cbc')
 
 _targets='bios efi32'
 case "$CARCH" in
@@ -60,6 +62,9 @@
   # https://bugs.archlinux.org/task/61059
   patch -p1 < ../single-load-segment.patch
 
+  # https://bugs.archlinux.org/task/59987
+  patch -p1 < ../prevent-pow-optimization.patch
+
   # do not swallow efi compilation output to make debugging easier
   sed 's|> /dev/null 2>&1||' -i efi/check-gnu-efi.sh
 

Added: prevent-pow-optimization.patch
===================================================================
--- prevent-pow-optimization.patch	                        (rev 0)
+++ prevent-pow-optimization.patch	2019-03-27 22:16:30 UTC (rev 349301)
@@ -0,0 +1,36 @@
+From: Lukas Schwaighofer <lukas at schwaighofer.name>
+Date: Tue, 26 Feb 2019 23:13:58 +0100
+Subject: Prevent optimizing the pow() function
+
+With the current GCC 8.2.0 from Debian, a section of code calling pow() in
+zzjson_parse.c is turned into a sequence calling exp(). Since no exp()
+implementation is available in syslinux those optimizations need to be
+disabled.
+---
+ com32/gpllib/zzjson/zzjson_parse.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/com32/gpllib/zzjson/zzjson_parse.c b/com32/gpllib/zzjson/zzjson_parse.c
+index ecb6f61..e66a9d8 100644
+--- a/com32/gpllib/zzjson/zzjson_parse.c
++++ b/com32/gpllib/zzjson/zzjson_parse.c
+@@ -138,6 +138,10 @@ static ZZJSON *parse_string2(ZZJSON_CONFIG *config) {
+     return zzjson;
+ }
+ 
++static double __attribute__((optimize("O0"))) pow_noopt(double x, double y) {
++	return pow(x, y);
++}
++
+ static ZZJSON *parse_number(ZZJSON_CONFIG *config) {
+     ZZJSON *zzjson;
+     unsigned long long ival = 0, expo = 0;
+@@ -213,7 +217,7 @@ skipexpo:
+     if (dbl) {
+         dval = sign * (long long) ival;
+         dval += sign * frac;
+-        dval *= pow(10.0, (double) signexpo * expo);
++        dval *= pow_noopt(10.0, (double) signexpo * expo);
+     }
+ 
+     zzjson = config->calloc(1, sizeof(ZZJSON));



More information about the arch-commits mailing list