Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2011-03

libQt4Pas on Ubuntu

25 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

zeljko

Hi,
Den, do you know who's package maintainer for libQt4Pas on Ubuntu ? Problem is with -mstackrealign, that should be added for ubuntu 10.10 which uses qt-4.7 (apps crashes). So package should be updated.

zeljko

Matthias Klumpp
to zeljko
zeljko wrote 5 lines
Hi, Den, do you know who's package maintainer for libQt4Pas on Ubuntu ? Problem is with -mstackrealign, that should be added for ubuntu 10.10 which uses qt-4.7 (apps crashes). So package should be updated.

I maintain the packages in Debian and Ubuntu. An updated version has already been prepared and is enqueued for Debian Sid. I can the ask for an FFe to make it available in Ubuntu too. Cheers,
Matthias Klumpp

zeljko
to Matthias Klumpp
Matthias Klumpp wrote 10 lines
On Wed, 30 Mar 2011 08:45:47 +0200, zeljko wrote: > Hi, > Den, do you know who's package maintainer for libQt4Pas on Ubuntu ? > Problem is with -mstackrealign, that should be added for ubuntu 10.10 > which > uses qt-4.7 (apps crashes). So package should be updated. I maintain the packages in Debian and Ubuntu. An updated version has already been prepared and is enqueued for Debian Sid. I can the ask for an FFe to make it available in Ubuntu too.

Thanks

zeljko

Matthias Klumpp
to zeljko: Den, do you know who's package maintainer for libQt4Pas on Ubuntu ? Problem is with…

Hi!
I applied the attached patch to the Debian and Ubuntu packages, which adds the -mstackrealign flag if an x86_64 or x86 platform is detected, as this GCC flag is not available for other targets than these two. You might want to add it to the upstream sources too. Cheers,
Matthias

zeljko wrote 7 lines
Hi, Den, do you know who's package maintainer for libQt4Pas on Ubuntu ? Problem is with -mstackrealign, that should be added for ubuntu 10.10 which uses qt-4.7 (apps crashes). So package should be updated. zeljko

-------------- next part --------------
Description: Compile Qt4 bindings with -mstackrealign. (Required for Qt >= 4.7, since sse2 is enabled by default) Forwarded: yes
Author: Matthias Klumpp
Last-Update: 2011-03-14
--- a/Qt4Pas.pro
+++ b/Qt4Pas.pro
@@ -31,12 +31,21 @@
CONFIG += dll
CONFIG += warn_off

+contains(QMAKE_HOST.arch, x86_64) {
+ message("Compiling with stackrealign on x86_64")
+ QMAKE_CXXFLAGS += -mstackrealign
+}
+
+contains(QMAKE_HOST.arch, x86) {
+ message("Compiling with stackrealign on x86")
+ QMAKE_CXXFLAGS += -mstackrealign
+}

!equals(QT_MAJOR_VERSION,4)|!equals(QT_MINOR_VERSION,5) { message("This pascal binding should be used for 4.5.3 and current Qt is" $$QT_VERSION) }

-# Available Binding Platforms: see http://wiki.freepascal.org/Qt4_binding#Supported_Platforms +# Available Binding Platforms: see http://wiki.freepascal.org/Qt4_binding#Supported_Platforms

target.path = $$[QT_INSTALL_LIBS]

@@ -44,18 +53,18 @@
PLATFORM = MSWINDOWS
target.path = $$[QT_INSTALL_BINS]
}
-
-embedded:PLATFORM = QTOPIA
+
+embedded:PLATFORM = QTOPIA

unix:!embedded:!mac:PLATFORM = BINUX

mac {
PLATFORM = DARWIN
CONFIG += lib_bundle
- }
+ }

message("Pascal Qt Interface for binding platform:" $$PLATFORM) -DEFINES += $$PLATFORM
+DEFINES += $$PLATFORM
message("Install location:" $$target.path)

INSTALLS += target

zeljko
to Matthias Klumpp
Matthias Klumpp wrote 5 lines
Hi! I applied the attached patch to the Debian and Ubuntu packages, which adds the -mstackrealign flag if an x86_64 or x86 platform is detected, as this GCC flag is not available for other targets than these two. You might want to add it to the upstream sources too.

I guess that this patch will work for Fedora and other packagers ?

zeljko

Den Jean
to Matthias Klumpp: Hi! I applied the attached patch to the Debian and Ubuntu packages, which adds the…
Matthias Klumpp wrote
I applied the attached patch to the Debian and Ubuntu packages, which adds

you might consider cleaning up the patch (not for me, but for Debian)

the -mstackrealign flag if an x86_64 or x86 platform is detected, as this

I found x86_64 in the Qt source code, but x86 ??? Did you test this :-) I tried on 32bit linux and got i686.
Reading the qt source code I see why: qmake/project.cpp

GCC flag is not available for other targets than these two.

Good that you noticed that. Does the compiling fail on other architectures ? Or do you just get a warning ?

However using QMAKE_HOST.arch will cause problems when cross compiling. see: http://bugreports.qt.nokia.com/browse/QTBUG-9160

You might want to add it to the upstream sources too.

I had already added mstackrealign in all cases,
I will now use : 86 as keyword, I hope there is no other architecture that has 86 in it

regards,

Den Jean

Matthias Klumpp
to Den Jean

Hi!

Den Jean wrote
On Wednesday 06 April 2011 14:10:54 Matthias Klumpp wrote: > I applied the attached patch to the Debian and Ubuntu packages, which > adds you might consider cleaning up the patch (not for me, but for Debian)

It just removes blank spaces at the end of lines - not dramatic, but right, I'll better clean it up.

> the -mstackrealign flag if an x86_64 or x86 platform is detected, as

this

I found x86_64 in the Qt source code, but x86 ??? Did you test this :-) I tried on 32bit linux and got i686. Reading the qt source code I see why: qmake/project.cpp

Oh, really ugly! I relied on a mailing list positing of a Qt dev, but just "x86" does not work indeed.

> GCC flag is not available for other targets than these two. Good that you noticed that. Does the compiling fail on other

architectures

? Or do you just get a warning ?

It fails, otherwise this patch would not have been necessary. (The first try broke all builds :( But the GCC docs say clearly this should only be used on x86_64 and x86)

However using QMAKE_HOST.arch will cause problems when cross compiling. see: http://bugreports.qt.nokia.com/browse/QTBUG-9160

Okay... This is no problem for Debian, but if there's a more sane solution, I'm happy to add it.

> You might want to add it to the upstream sources too. I had already added mstackrealign in all cases, I will now use : 86 as keyword, I hope there is no other architecture that has 86 in it

Can you do a bugfix upstream release or send me this patch or point me to your VCS if there is any?

Thanks!
Matthias

Den Jean
to Matthias Klumpp
Show quoted text 5 lines
> However using QMAKE_HOST.arch will cause problems when cross compiling. > see: http://bugreports.qt.nokia.com/browse/QTBUG-9160 Okay... This is no problem for Debian, but if there's a more sane solution, I'm happy to add it.

Perhaps Debian cross compiles for the arm releases

Can you do a bugfix upstream release or send me this patch

the qmake function contains does not work for substr, will look into it. I will make a new release when the
needed patches of the previous release(V2.2) are incorporated.

Matthias Klumpp
to Den Jean
Den Jean wrote
> > However using QMAKE_HOST.arch will cause problems when cross

compiling.

Show quoted text 10 lines
> > see: http://bugreports.qt.nokia.com/browse/QTBUG-9160 > > Okay... This is no problem for Debian, but if there's a more sane > solution, I'm happy to add it. Perhaps Debian cross compiles for the arm releases > Can you do a bugfix upstream release or send me this patch the qmake function contains does not work for substr, will look into it. I will make a new release when the needed patches of the previous release(V2.2) are incorporated.

Okay, thanks! Please note the following: This change will most likely not be in Ubuntu Natty, as we're in Main Release Freeze soon. Also, if the new release breaks compatibility with LCL 0.9.30, I don't know if I can include it, because there are applications in Debian requiring the Qt LCL.
Cheers,
Matthias

Den Jean
to Matthias Klumpp
Matthias Klumpp wrote 5 lines
Okay, thanks! Please note the following: This change will most likely not be in Ubuntu Natty, as we're in Main Release Freeze soon. Also, if the new release breaks compatibility with LCL 0.9.30, I don't know if I can include it, because there are applications in Debian requiring the Qt LCL.

The patches I submitted are necessary for one platform and do not change anything on the other platforms.

Can Zeljko give me a timing when these will be applied ?

It would be nice to have the next release unite all platforms again.

zeljko
to Den Jean
Den Jean wrote 11 lines
On Sunday 10 April 2011 14:22:22 Matthias Klumpp wrote: > Okay, thanks! Please note the following: This change will most likely not > be in Ubuntu Natty, as we're in Main Release Freeze soon. > Also, if the new release breaks compatibility with LCL 0.9.30, I don't > know if I can include it, because there are applications in Debian > requiring the Qt LCL. The patches I submitted are necessary for one platform and do not change anything on the other platforms. Can Zeljko give me a timing when these will be applied ?

It's up to you. If we don't change minimum lib version (4.5) then you can prepare update anytime.

zeljko

Show quoted text 8 lines
It would be nice to have the next release unite all platforms again. _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt
Den Jean
to zeljko
zeljko wrote 9 lines
> The patches I submitted are necessary for one platform and > do not change anything on the other platforms. > > > > Can Zeljko give me a timing when these will be applied ? It's up to you. If we don't change minimum lib version (4.5) then you can prepare update anytime.

I think you misunderstand, I am awaiting application of the the patches supplied in June 2010 for V2.2, this will allow me to create a new binding V2.3 starting from the last work. http://lists.lazarus.freepascal.org/pipermail/qt/2010-June/001547.html

zeljko
to Den Jean
Den Jean wrote 15 lines
On Tuesday 12 April 2011 17:32:20 zeljko wrote: > > The patches I submitted are necessary for one platform and > > do not change anything on the other platforms. > > > > > > > > Can Zeljko give me a timing when these will be applied ? > > It's up to you. If we don't change minimum lib version (4.5) then you can > prepare update anytime. I think you misunderstand, I am awaiting application of the the patches supplied in June 2010 for V2.2, this will allow me to create a new binding V2.3 starting from the last work. http://lists.lazarus.freepascal.org/pipermail/qt/2010-June/001547.html

Maybe, so I have to apply maemo patch and that's it ?

zeljko

Show quoted text 6 lines
_______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt
Den Jean
to zeljko
zeljko wrote
Maybe, so I have to apply maemo patch and that's it ?

yes, and after release the latest qt4.pas (probably compatible)

zeljko
to Den Jean
Den Jean wrote
On Tuesday 12 April 2011 18:51:39 zeljko wrote: > Maybe, so I have to apply maemo patch and that's it ? yes, and after release the latest qt4.pas (probably compatible)

What do you mean by this ? change qt4.pas to use maemo (it's in patch already) or what ?

zeljko

Den Jean
to zeljko
zeljko wrote
What do you mean by this ? change qt4.pas to use maemo (it's in patch already) or what ?

When I make the new release, it will provide again a new qt4.pas. I do not know yet what will be the differences, but they should be compatible.

zeljko
to Den Jean
Den Jean wrote 7 lines
On Tuesday 12 April 2011 19:13:37 zeljko wrote: > What do you mean by this ? change qt4.pas to use maemo (it's in patch > already) or what ? When I make the new release, it will provide again a new qt4.pas. I do not know yet what will be the differences, but they should be compatible.

Uf... I'm confused now :) ... just tell me what should I do and I'll do that :)

zeljko

Vincent Snijders
to zeljko

2011/4/13 zeljko :

Show quoted text 11 lines
On Tuesday 12 of April 2011 21:11:14 Den Jean wrote: > On Tuesday 12 April 2011 19:13:37 zeljko wrote: > > What do you mean by this ? change qt4.pas to use maemo (it's in patch > > already) ?or what ? > > When I make the new release, it will provide again a new qt4.pas. > I do not know yet what will be the differences, but they should > be compatible. Uf... I'm confused now :) ... just tell me what should I do and I'll do that :)

Apply this patch:
Patch for Lazarus:
http://users.telenet.be/Jan.Van.hijfte/qtforfpc/maemo.diff.txt.tar.gz

Vincent

Den Jean
to Matthias Klumpp: Hi! It just removes blank spaces at the end of lines - not dramatic, but right, I'll…
Matthias Klumpp wrote 15 lines
Oh, really ugly! I relied on a mailing list positing of a Qt dev, but just "x86" does not work indeed. >> GCC flag is not available for other targets than these two. > > Good that you noticed that. Does the compiling fail on other architectures > ? > Or do you just get a warning ? It fails, otherwise this patch would not have been necessary. (The first try broke all builds :( But the GCC docs say clearly this should only be used on x86_64 and x86)

could you try this for one or more platforms you
have (32/64 win/linux/osx) and inform me if it works.

I only found time for 32bit Linux.

Qt4Pas.pro:

...
X86 = $$find(QMAKE_HOST.arch, i*86)
! isEmpty( X86 ) {
message("Added -mstackrealign to CXXFLAGS in support of SSE on arch " $$QMAKE_HOST.arch) QMAKE_CXXFLAGS += -mstackrealign
}
...

Unknown author
to Den Jean
Den Jean wrote 12 lines
I only found time for 32bit Linux. Qt4Pas.pro: ... X86 = $$find(QMAKE_HOST.arch, i*86) ! isEmpty( X86 ) { message("Added -mstackrealign to CXXFLAGS in support of SSE on arch " $$QMAKE_HOST.arch) QMAKE_CXXFLAGS += -mstackrealign }

There's also problem with qt-4.7 under windows (someone reported on lazarus forum). dll should be compiled with -mstackrealign, if mingw gcc compiler doesn't support then
we can do nothing, except rebuilding complete qt on win32 with disabled sse2.

zeljko

Den Jean
to Den Jean: When I make the new release, it will provide again a new qt4.pas. I do not know yet what…
Den Jean wrote
When I make the new release, it will provide again a new qt4.pas. I do not know yet what will be the differences, but they should be compatible.

whilst comparing a new qt4.pas with the one in lazarus trunk I found that GetPtrIntArrayAddr was changed downstream. Were there problems? I do not remember. I just like to know.

>>>... original (mine) ...
// PtrInt Array Access from c-code
function GetPtrIntArrayAddr(PArr : PPtrIntArray): PPtrInt; cdecl; export;
begin
    Result := @PArr^[0];
end;
>>>... lazarus trunk ...
// PtrInt Array Access from c-code
function GetPtrIntArrayAddr(PArr : PPtrIntArray): PPtrInt; cdecl; export;
begin
  if PArr^ = nil then                 <---------- extra
    Result := nil                     <---------- extra
  else                                <---------- extra
    Result := @PArr^[0];
end;
Vincent Snijders
to Den Jean

2011/4/13 Den Jean :

Show quoted text 25 lines
On Tuesday 12 April 2011 21:11:14 Den Jean wrote: > When I make the new release, it will provide again a new qt4.pas. > I do not know yet what will be the differences, but they should > be compatible. whilst comparing a new qt4.pas with the one in lazarus trunk I found that GetPtrIntArrayAddr was changed downstream. Were there problems? I do not remember. I just like to know. >>>>... original (mine) ... // PtrInt Array Access from c-code function GetPtrIntArrayAddr(PArr : PPtrIntArray): PPtrInt; cdecl; export; begin ? ?Result := @PArr^[0]; end; >>>>... lazarus trunk ... // PtrInt Array Access from c-code function GetPtrIntArrayAddr(PArr : PPtrIntArray): PPtrInt; cdecl; export; begin ?if PArr^ = nil then ? ? ? ? ? ? ? ? <---------- extra ? ?Result := nil ? ? ? ? ? ? ? ? ? ? <---------- extra ?else ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<---------- extra ? ?Result := @PArr^[0]; end;

The change was in
http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&root=lazarus&revision=25368

Do you want me to ask Martin for further explanation?

Vincent

Den Jean
to Vincent Snijders
Vincent Snijders wrote
Do you want me to ask Martin for further explanation?

yes please, changes like this can be valid fixes
but can also hide root causes. And pointers
should always be taken serious :-)
This code is old, I am not looking forward
having to go through all use case :-(

zeljko
to Den Jean
Den Jean wrote 8 lines
On Wednesday 13 April 2011 22:43:38 Vincent Snijders wrote: > Do you want me to ask Martin for further explanation? yes please, changes like this can be valid fixes but can also hide root causes. And pointers should always be taken serious :-) This code is old, I am not looking forward having to go through all use case :-(

huuuu...I haven't seen this change hmmm....Den is there any other change in qt45.pas ? Martin ?

zeljko

Den Jean

huuuu...I haven't seen this change hmmm....Den is there any other change in qt45.pas ?

no