diff mbox series

[bug#66263,22/23] guix: meson-build-system: Disable PIC for AVR.

Message ID 20230929091627.7820-22-jean@foundationdevices.com
State New
Headers show
Series guix: Add avr as a platform. | expand

Commit Message

Jean-Pierre De Jesus DIAZ Sept. 29, 2023, 9:16 a.m. UTC
* guix/build-system/meson.scm (make-built-in-options-alist): New
  variable.

* guix/build-system/meson.scm (make-cross-file): Add 'built-in options'
  section to cross file.
---
 guix/build-system/meson.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Maxim Cournoyer Oct. 5, 2023, 3:14 p.m. UTC | #1
Hello,

Jean-Pierre De Jesus DIAZ <jean@foundationdevices.com> writes:

> * guix/build-system/meson.scm (make-built-in-options-alist): New
>   variable.
>
> * guix/build-system/meson.scm (make-cross-file): Add 'built-in options'
>   section to cross file.

I'm no Meson expert, but that LGTM.
diff mbox series

Patch

diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm
index b894789fb8..92e47285d6 100644
--- a/guix/build-system/meson.scm
+++ b/guix/build-system/meson.scm
@@ -92,6 +92,13 @@  (define (make-binaries-alist triplet)
     (ld . ,(string-append triplet "-ld"))
     (strip . ,(string-append triplet "-strip"))))
 
+(define (make-built-in-options-alist triplet)
+  (if (target-avr? triplet)
+      `((b_pie . #f)
+        (b_staticpic . #f)
+        (default_library . "static"))
+       '()))
+
 (define (make-cross-file triplet)
   (computed-file "cross-file"
     (with-imported-modules '((guix build meson-configuration))
@@ -102,7 +109,9 @@  (define (make-cross-file triplet)
               (write-section-header port "host_machine")
               (write-assignments port '#$(make-machine-alist triplet))
               (write-section-header port "binaries")
-              (write-assignments port '#$(make-binaries-alist triplet))))))))
+              (write-assignments port '#$(make-binaries-alist triplet))
+              (write-section-header port "built-in options")
+              (write-assignments port '#$(make-built-in-options-alist triplet))))))))
 
 (define %meson-build-system-modules
   ;; Build-side modules imported by default.