diff mbox series

[bug#73190,2/3] gnu: make-libiberty: Build with -fPIC.

Message ID c11e82527f0d4e9aaaffa538a8c5b127f9a782d4.1726106463.git.mcsinyx@disroot.org
State New
Headers show
Series gnu: dyninst: Update to 13.0.0. | expand

Commit Message

guix-patches--- via Sept. 12, 2024, 2:28 a.m. UTC
Since iberty is a static library, linking a PIC-enabled target to it
requires it to also have been built with PIC.  (The target is Dyninst
in this case.)

* gnu/packages/gcc.scm (make-libiberty)[arguments]:
  Adjust make-flags to add -fPIC to CFLAGS.

Change-Id: I155045d05f4434cb68be933a95b7bc9fdec98818
---
 gnu/packages/gcc.scm | 1 +
 1 file changed, 1 insertion(+)

Comments

Ludovic Courtès Sept. 12, 2024, 5 p.m. UTC | #1
Hello,

Nguyễn Gia Phong <mcsinyx@disroot.org> skribis:

> Since iberty is a static library, linking a PIC-enabled target to it
> requires it to also have been built with PIC.  (The target is Dyninst
> in this case.)
>
> * gnu/packages/gcc.scm (make-libiberty)[arguments]:
>   Adjust make-flags to add -fPIC to CFLAGS.
>
> Change-Id: I155045d05f4434cb68be933a95b7bc9fdec98818

[...]

> +       #:make-flags '("CFLAGS=-fPIC")

I believe this overrides the default ‘CFLAGS’, and the end result is
that the library would be compiled with ‘-O0 -g0’.

So unless I’m mistaken, you should instead have:

  "CFLAGS=-O2 -g -fPIC"

Apart from that, the patch series looks good to me.

Could you send updated patches?

Thanks in advance,
Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index fef05b0c32d6..9da2d629cce7 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -1064,6 +1064,7 @@  (define (make-libiberty gcc)
     (name "libiberty")
     (arguments
      `(#:out-of-source? #t
+       #:make-flags '("CFLAGS=-fPIC")
        #:phases
        (modify-phases %standard-phases
          (add-before 'configure 'chdir