[gnome-build-meta/emersonbernier/buildflags: 2/2] project.conf: use default buildflags from freedesktop-sdk



commit bb04205face22f8e89c1a235e456a8bba093adb3
Author: Emerson Bernier <11860-EmersonBernier users noreply gitlab gnome org>
Date:   Mon Nov 26 16:00:56 2018 +0100

    project.conf: use default buildflags from freedesktop-sdk
    
    Closes https://gitlab.gnome.org/GNOME/gnome-build-meta/issues/46

 project.conf | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/project.conf b/project.conf
index 3adf089..1c964e5 100644
--- a/project.conf
+++ b/project.conf
@@ -69,11 +69,26 @@ mirrors:
 #
 environment:
   LC_ALL: en_US.UTF-8
-  LDFLAGS: -L%{libdir}
   LD_LIBRARY_PATH: '%{libdir}'
   PATH: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
   PKG_CONFIG_PATH: /usr/local/lib/pkgconfig:%{libdir}/pkgconfig
-
+  (?):
+    - arch == "x86_64":
+        CFLAGS:  "%{flags_x86_64}"
+        CXXFLAGS: "%{flags_x86_64}"
+        LDFLAGS:  "%{ldflags_defaults}"
+    - arch == "i686":
+        CFLAGS: "%{flags_i686}"
+        CXXFLAGS: "%{flags_i686}"
+        LDFLAGS:  "%{ldflags_defaults}"
+    - arch == "arm":
+        CFLAGS:  "%{flags_arm}"
+        CXXFLAGS: "%{flags_arm}"
+        LDFLAGS:  "%{ldflags_defaults}"
+    - arch == "aarch64":
+        CFLAGS:  "%{flags_aarch64}"
+        CXXFLAGS: "%{flags_aarch64}"
+        LDFLAGS:  "%{ldflags_defaults}"
 
 # Some overrides to element configuration based on type
 #
@@ -197,6 +212,12 @@ variables:
   localstatedir: "%{prefix}/var"
   indep-libdir: "%{prefix}/lib"
   debugdir: "%{indep-libdir}/debug"
+  common_flags: "-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions 
-fstack-protector-strong -grecord-gcc-switches"
+  flags_x86_64: "-march=x86-64 -mtune=generic %{common_flags} -fasynchronous-unwind-tables 
-fstack-clash-protection -fcf-protection"
+  flags_i686: "-march=i686 -mtune=generic %{common_flags} -fasynchronous-unwind-tables 
-fstack-clash-protection -fcf-protection"
+  flags_aarch64: "%{common_flags} -fasynchronous-unwind-tables -fstack-clash-protection"
+  flags_arm: "%{common_flags}"
+  ldflags_defaults: "-Wl,-z,relro,-z,now -Wl,--as-needed -L%{libdir}"
 
   (?):
     - arch == "i686":


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]