[bug#72878] gnu: plasma-nm: Fix build on aarch64

Message ID 9db081b3c256086fd4092beab2e2bde56d564182.1724945820.git.sepeth@fastmail.com
State New
Headers
Series [bug#72878] gnu: plasma-nm: Fix build on aarch64 |

Commit Message

Doğan Çeçen Aug. 29, 2024, 3:37 p.m. UTC
  * gnu/packages/qt.scm (qtcoro-qt6): pass -fPIC explicitly

Change-Id: Ifb26600945548d84df2cc70318781d87253af476
---
 gnu/packages/qt.scm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)


base-commit: d5312370b46ace47e138d84e1bb28e5651cee94b
  

Comments

Doğan Çeçen Aug. 29, 2024, 6:35 p.m. UTC | #1
Sorry for not adding a little context, I was battling with my email config.

Anyhow, I was getting the following error when installing plasma-nm:

--8<---------------cut here---------------start------------->8---
ld: /gnu/store/drbppxblx1gf943dxilhwz5vags287ir-qcoro-qt6-0.10.0/lib/libQCoro6DBus.a(qcorodbuspendingcall.cpp.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_ZN23QDBusPendingCallWatcher8finishedEPS_@@Qt_6' which may bind externally can not be used when making a shared object; recompile with -fPIC
ld: /gnu/store/drbppxblx1gf943dxilhwz5vags287ir-qcoro-qt6-0.10.0/lib/libQCoro6DBus.a(qcorodbuspendingcall.cpp.o)(.text+0xb0): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `_ZN23QDBusPendingCallWatcher8finishedEPS_@@Qt_6'
ld: final link failed: bad value
--8<---------------cut here---------------end--------------->8---

The problem seemed to be qcoro-qt6. I checked its logs on x86_64, and it seems -fPIC is being passed:

https://ci.guix.gnu.org/build/5466920/details

Unfortunately, aarch64 build is still Scheduled:

https://ci.guix.gnu.org/build/5454563/details

Anyhow, the suggestion that the linker gave has worked, which is adding -fPIC.
  
Zheng Junjie Sept. 1, 2024, 2:08 a.m. UTC | #2
Doğan Çeçen <sepeth@fastmail.com> writes:

Title should "gnu: qcoro-qt: Build with -fPIC.", because it change qcoro-qt{5,6}.

> * gnu/packages/qt.scm (qtcoro-qt6): pass -fPIC explicitly

* gnu/packages/qt.scm (qcoro-qt5, qcoro-qt6)[arguments]: Adjust
  configure-flags to add -fPIC to CMAKE_CXX_FLAGS.
  
>
> Change-Id: Ifb26600945548d84df2cc70318781d87253af476
> ---
>  gnu/packages/qt.scm | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
> index a91bebf358..974af2a342 100644
> --- a/gnu/packages/qt.scm
> +++ b/gnu/packages/qt.scm
> @@ -153,10 +153,11 @@ (define-public qcoro-qt5
>      (build-system qt-build-system)
>      (arguments
>       (list #:configure-flags
> -           #~(list (string-append "-DUSE_QT_VERSION="
> +           #~(list "-DCMAKE_CXX_FLAGS=-fPIC"
> +                   (string-append "-DUSE_QT_VERSION="
>                                    #$(version-major
> -                                     (package-version
> -                                      (this-package-input "qtbase")))))))
> +                                      (package-version
> +                                        (this-package-input "qtbase")))))))
>      (native-inputs (list dbus))         ;for tests
>      (inputs (list qtbase-5 qtdeclarative-5 qtwebsockets-5))
>      (home-page "https://qcoro.dvratil.cz/")
> @@ -169,6 +170,7 @@ (define-public qcoro-qt6
>    (package
>      (inherit qcoro-qt5)
>      (name "qcoro-qt6")
> +    (synopsis "C++ Coroutine Library for Qt6")

please split to a new patch.

>      (inputs (modify-inputs (package-inputs qcoro-qt5)
>                (replace "qtbase" qtbase)
>                (replace "qtdeclarative" qtdeclarative)
>
> base-commit: d5312370b46ace47e138d84e1bb28e5651cee94b
  

Patch

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index a91bebf358..974af2a342 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -153,10 +153,11 @@  (define-public qcoro-qt5
     (build-system qt-build-system)
     (arguments
      (list #:configure-flags
-           #~(list (string-append "-DUSE_QT_VERSION="
+           #~(list "-DCMAKE_CXX_FLAGS=-fPIC"
+                   (string-append "-DUSE_QT_VERSION="
                                   #$(version-major
-                                     (package-version
-                                      (this-package-input "qtbase")))))))
+                                      (package-version
+                                        (this-package-input "qtbase")))))))
     (native-inputs (list dbus))         ;for tests
     (inputs (list qtbase-5 qtdeclarative-5 qtwebsockets-5))
     (home-page "https://qcoro.dvratil.cz/")
@@ -169,6 +170,7 @@  (define-public qcoro-qt6
   (package
     (inherit qcoro-qt5)
     (name "qcoro-qt6")
+    (synopsis "C++ Coroutine Library for Qt6")
     (inputs (modify-inputs (package-inputs qcoro-qt5)
               (replace "qtbase" qtbase)
               (replace "qtdeclarative" qtdeclarative)