Re: [Qbs] avoid RPATH pointing to Qt installation folder

2019-10-08 Thread Heiko Nardmann
Am 08.10.19 um 12:00 schrieb Christian Kandeler:
> On Tue, 8 Oct 2019 11:39:09 +0200
> Heiko Nardmann  wrote:
>
>> The question is whether to include Qt.core.libPath (as defined inside
>> core.qbs) into the list of rpaths. If I put it into the list then it
>> also is part of the binaries RPATH - which I want to avoid. I I leave it
>> out then I get ld error wrt. the ICU libs - which Qt.core is depending on.
> I don't know what error you are getting. If it's just that the lib is not 
> found, try setting cpp.libraryPaths.
>
>
> Christian
> ___
> Qbs mailing list
> Qbs@qt-project.org
> https://lists.qt-project.org/listinfo/qbs

Here is the commandline that I use and the resulting error message with
cpp.rpaths empty inside core.qbs:

/home/heiko.nardmann/QtCreator/4.8.2/bin/qbs build --build-directory
build --file test.qbs  --command-echo-mode command-line
config:linux64-gcc-qt5-12-3-debug profile:linux64-gcc-qt5-12-3 
qbs.buildVariant:debug

Restoring build graph from disk

Resolving project for configuration linux64-gcc-qt5-12-3-debug

Building for configuration linux64-gcc-qt5-12-3-debug

/usr/bin/g++ -Wl,-m,elf_x86_64
-L/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib -m64 -o

/home/heiko.nardmann/projects/trunk/QBS-Probleme/Qt-Deps/build/linux64-gcc-qt5-12-3-debug/A.6dcd4ce2/A

/home/heiko.nardmann/projects/trunk/QBS-Probleme/Qt-Deps/build/linux64-gcc-qt5-12-3-debug/A.6dcd4ce2/3a52ce780950d4d9/A.cpp.o
/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3
-lpthread

ERROR: /usr/bin/g++ -Wl,-m,elf_x86_64
-L/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib -m64 -o

/home/heiko.nardmann/projects/trunk/QBS-Probleme/Qt-Deps/build/linux64-gcc-qt5-12-3-debug/A.6dcd4ce2/A

/home/heiko.nardmann/projects/trunk/QBS-Probleme/Qt-Deps/build/linux64-gcc-qt5-12-3-debug/A.6dcd4ce2/3a52ce780950d4d9/A.cpp.o
/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3
-lpthread

 

ERROR: /usr/bin/ld: warning: libicui18n.so.56, needed by
/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3,
not found (try using -rpath or -rpath-link)

/usr/bin/ld: warning: libicuuc.so.56, needed by
/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3,
not found (try using -rpath or -rpath-link)

/usr/bin/ld: warning: libicudata.so.56, needed by
/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3,
not found (try using -rpath or -rpath-link)

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucal_clone_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucnv_close_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucol_setAttribute_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucnv_setSubstChars_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucal_close_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucal_openTimeZoneIDEnumeration_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucnv_fromUnicode_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `uenum_close_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucnv_getDefaultName_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucal_inDaylightTime_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucnv_compareNames_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucal_open_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucnv_getAlias_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucnv_countAvailable_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `u_strToLower_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucal_getDefaultTimeZone_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucal_openCountryTimeZones_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucal_getDSTSavings_56'

/home/heiko.nardmann/Qt/Online/5.12.3/gcc_64/lib/libQt5Core.so.5.12.3:
undefined reference to `ucol_close_56'

/home/heiko.nardmann/Qt/Online/5.12

Re: [Qbs] avoid RPATH pointing to Qt installation folder

2019-10-08 Thread Christian Kandeler
On Tue, 8 Oct 2019 11:39:09 +0200
Heiko Nardmann  wrote:

> The question is whether to include Qt.core.libPath (as defined inside
> core.qbs) into the list of rpaths. If I put it into the list then it
> also is part of the binaries RPATH - which I want to avoid. I I leave it
> out then I get ld error wrt. the ICU libs - which Qt.core is depending on.

I don't know what error you are getting. If it's just that the lib is not 
found, try setting cpp.libraryPaths.


Christian
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] avoid RPATH pointing to Qt installation folder

2019-10-08 Thread Heiko Nardmann
Am 08.10.19 um 10:51 schrieb Christian Kandeler:
> On Tue, 8 Oct 2019 09:53:32 +0200
> Heiko Nardmann  wrote:
>
>> I'm looking for a way to prevent the RPATH of an executable pointing to
>> the installed Qt. From the "core.qbs" file I see that cpp.rpaths is set
>> to libPath for Linux by default.
> There should probably be a Qt.core property that controls this. Until then, 
> you'll have to force-override cpp.rpaths in your app product:
>
> Properties {
> condition: true
> overrideListProperties: true
> cpp.rpaths: [ /* full list of your rpaths */ ]
> }
>
> (Of course, if you don't want any RPATH at all, then "cpp.useRPaths: false" 
> is the way to go.)
>
>
> Christian

The question is whether to include Qt.core.libPath (as defined inside
core.qbs) into the list of rpaths. If I put it into the list then it
also is part of the binaries RPATH - which I want to avoid. I I leave it
out then I get ld error wrt. the ICU libs - which Qt.core is depending on.

Yes, probably there is a property missing that states which paths to use
for "-rpath-link": "-rpath" is for runtime while "-rpath-link" is for
link time. As I'm deploying the Qt libs together with the application I
need cpp.rpaths to control runtime. Just omitting the path to the
installed Qt and at the same time pleasing the linker is currently the
problem ...

Any workaround other than useRPaths: false and trying to completely
controlling linker flags?


/Kind regards,/

  Heiko

___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] avoid RPATH pointing to Qt installation folder

2019-10-08 Thread Jochen Ulrich
> If I just set
> cpp.rpaths: [ ]
> then I get a linker error wrt. missing ICU libs?

You should try setting the RPATHs to an array of paths which tell the loader 
where to find the libraries.

For example, if your deployment looks like this:

myApp/bin/myApp (the executable)
myApp/lib/libQt5Core.so.5
myApp/lib/...

you might be able to do something like this for the executable:

cpp.rpaths: [ "$ORIGIN/../lib" ]

However, note that you might require different RPATHs during development if you 
want to run the executable without setting up the complete deployment directory 
structure first.

Also note that there are certain security issues with RPATHs. See for example 
https://security.stackexchange.com/a/165762/125269

Kind regards
Jochen Ulrich



___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] avoid RPATH pointing to Qt installation folder

2019-10-08 Thread Christian Kandeler
On Tue, 8 Oct 2019 09:53:32 +0200
Heiko Nardmann  wrote:

> I'm looking for a way to prevent the RPATH of an executable pointing to
> the installed Qt. From the "core.qbs" file I see that cpp.rpaths is set
> to libPath for Linux by default.

There should probably be a Qt.core property that controls this. Until then, 
you'll have to force-override cpp.rpaths in your app product:

Properties {
condition: true
overrideListProperties: true
cpp.rpaths: [ /* full list of your rpaths */ ]
}

(Of course, if you don't want any RPATH at all, then "cpp.useRPaths: false" is 
the way to go.)


Christian
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


[Qbs] avoid RPATH pointing to Qt installation folder

2019-10-08 Thread Heiko Nardmann
Hi together,

I'm looking for a way to prevent the RPATH of an executable pointing to
the installed Qt. From the "core.qbs" file I see that cpp.rpaths is set
to libPath for Linux by default.

So ... do I have to change this file "core.qbs"??? The RPATH shall point
to the Qt that I deploy together with the application.

If I just set

cpp.rpaths: [ ]

then I get a linker error wrt. missing ICU libs?

Thanks!


/Kind regards,/

  Heiko


___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs