[tor-commits] [tor-browser-build/master] Bug 40262: Remove -march=native from lucetc build flags

gk at torproject.org gk at torproject.org
Tue Apr 6 07:41:55 UTC 2021


commit d628abb8f6a8301c93f5315a8ff3b19269401783
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Mon Mar 29 13:49:12 2021 +0200

    Bug 40262: Remove -march=native from lucetc build flags
---
 .../Remove-march-native-from-COMMON_CFLAGS.patch   | 24 ++++++++++++++++++++++
 projects/lucetc/build                              |  2 ++
 projects/lucetc/config                             |  1 +
 3 files changed, 27 insertions(+)

diff --git a/projects/lucetc/Remove-march-native-from-COMMON_CFLAGS.patch b/projects/lucetc/Remove-march-native-from-COMMON_CFLAGS.patch
new file mode 100644
index 0000000..13b16db
--- /dev/null
+++ b/projects/lucetc/Remove-march-native-from-COMMON_CFLAGS.patch
@@ -0,0 +1,24 @@
+From ce82762aef3f8cdbdd340f39f95d2491f69a7da0 Mon Sep 17 00:00:00 2001
+From: Nicolas Vigier <boklm at torproject.org>
+Date: Mon, 29 Mar 2021 13:42:48 +0200
+Subject: [PATCH] Remove -march=native from COMMON_CFLAGS
+
+The -march=native flag is causing an error on some hardware. It can also
+make the build non-reproducible when not building on the same hardware.
+---
+ lucet-builtins/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lucet-builtins/Makefile b/lucet-builtins/Makefile
+index 6ddbcfd..de7e540 100644
+--- a/lucet-builtins/Makefile
++++ b/lucet-builtins/Makefile
+@@ -7,7 +7,7 @@ LIBBUILTINS_OBJS:=$(addprefix build/, \
+ 	strcmp.o \
+ 	strlen.o )
+ 
+-COMMON_CFLAGS:= --std=gnu99 -Ofast -Wall -Werror -march=native -fPIC \
++COMMON_CFLAGS:= --std=gnu99 -Ofast -Wall -Werror -fPIC \
+ 	-I../lucet-runtime/include
+ 
+ default: build/libbuiltins.so
diff --git a/projects/lucetc/build b/projects/lucetc/build
index 208f4e1..e06c272 100644
--- a/projects/lucetc/build
+++ b/projects/lucetc/build
@@ -47,6 +47,8 @@ replace-with = "vendored-sources"
 directory = "/var/tmp/build/lucetc/vendor"
 EOF
 
+patch -p1 < $rootdir/Remove-march-native-from-COMMON_CFLAGS.patch
+
 make -j[% c("buildconf/num_procs") %] build
 # XXX: Should not be needed, just the lucetc binary, see: taskcluster/scripts/misc/build-lucetc.sh
 make install
diff --git a/projects/lucetc/config b/projects/lucetc/config
index 72b79fe..0007201 100644
--- a/projects/lucetc/config
+++ b/projects/lucetc/config
@@ -31,3 +31,4 @@ input_files:
   # the sources.
   - URL: https://people.torproject.org/~gk/mirrors/sources/lucetc-vendor.tar.bz2
     sha256sum: 12ba97fca12177e7ed5b5409fcfdbd31dc7db2e82282768d99dee5bcb1b1246a
+  - filename: Remove-march-native-from-COMMON_CFLAGS.patch





More information about the tor-commits mailing list