Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#60418 closed defect (fixed)

qt4-creator-mac @2.8.1_3 fails building on 10.5.8 PPC

Reported by: udbraumann Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: leopard Cc:
Port: qt4-creator-mac

Description

While upgrading qt4-creator-mac from 2.8.1_2 to 2.8.1_3 compiling ends up in severe trouble concerning the apparently bundled botan:

...
:info:build /usr/bin/g++-4.2 -c -pipe -mmacosx-version-min=10.5 -fPIC -ansi -fpermissive -finline-functions -Wno-long-long -O2 -arch ppc -fvisibility=hidden -Wall -W -fPIC -DQSSH_LIBRARY -DIDE_LIBRARY_BASENAME=\"lib\" -DQT_CREATOR -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DBOTAN_DLL= -DBOTAN_TARGET_OS_HAS_GETTIMEOFDAY -DBOTAN_HAS_ALLOC_MMAP -DBOTAN_HAS_ENTROPY_SRC_DEV_RANDOM -DBOTAN_HAS_ENTROPY_SRC_EGD -DBOTAN_HAS_ENTROPY_SRC_FTW -DBOTAN_HAS_ENTROPY_SRC_UNIX -DBOTAN_HAS_MUTEX_PTHREAD -DBOTAN_HAS_PIPE_UNIXFD_IO -DBOTAN_TARGET_OS_IS_DARWIN -DBOTAN_BUILD_COMPILER_IS_GCC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/local/libexec/qt4/share/mkspecs/macx-g++ -I. -I.moc/release-shared -I/opt/local/libexec/qt4/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtGui.framework/Versions/4/Headers -I../../../src -I../../libs -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_qt4-creator-mac/qt4-creator-mac/work/qt-creator-2.8.1-src/tools -I../../plugins -I../3rdparty -I/opt/local/libexec/qt4/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/libexec/qt4/include -I.uic -F/opt/local/libexec/qt4/Library/Frameworks -F/opt/local/libexec/qt4/lib -o .obj/release-shared/botan.o ../3rdparty/botan/botan.cpp
:info:build ../3rdparty/botan/botan.cpp:46252:4: warning: #warning "No method of calling CPUID for this compiler"
:info:build ../3rdparty/botan/botan.cpp:46667: warning: unused parameter ‘ptr’
:info:build ../3rdparty/botan/botan.cpp:46667: warning: unused parameter ‘bytes’
:info:build ../3rdparty/botan/botan.cpp:46681: warning: unused parameter ‘ptr’
:info:build ../3rdparty/botan/botan.cpp:46681: warning: unused parameter ‘bytes’
:info:build {standard input}:2489:Invalid mnemonic 'bswapl'
:info:build {standard input}:2490:Invalid mnemonic 'bswapl'
...

and hundreds of such lines von Invalid mnemonic 'bswapl' follow, but suddenly some errors are reported:

...
:info:build {standard input}:13835:Invalid mnemonic 'bswapl'
:info:build ../3rdparty/botan/botan.cpp: In function ‘void Botan::bigint_linmul2(Botan::word*, size_t, Botan::word)’:
:info:build ../3rdparty/botan/botan.cpp:2469: error: unknown register name ‘%edx’ in ‘asm’
:info:build ../3rdparty/botan/botan.cpp:2469: error: unknown register name ‘%eax’ in ‘asm’
:info:build ../3rdparty/botan/botan.cpp: In function ‘void Botan::bigint_linmul3(Botan::word*, const Botan::word*, size_t, Botan::word)’:
:info:build ../3rdparty/botan/botan.cpp:2482: error: unknown register name ‘%edx’ in ‘asm’
:info:build ../3rdparty/botan/botan.cpp:2482: error: unknown register name ‘%eax’ in ‘asm’
:info:build ../3rdparty/botan/botan.cpp: In function ‘void Botan::bigint_simple_sqr(Botan::word*, const Botan::word*, size_t)’:
:info:build ../3rdparty/botan/botan.cpp:2495: error: unknown register name ‘%edx’ in ‘asm’
:info:build ../3rdparty/botan/botan.cpp:2495: error: unknown register name ‘%eax’ in ‘asm’
:info:build ../3rdparty/botan/botan.cpp: In function ‘void Botan::bigint_simple_mul(Botan::word*, const Botan::word*, size_t, const Botan::word*, size_t)’:
:info:build ../3rdparty/botan/botan.cpp:2495: error: unknown register name ‘%edx’ in ‘asm’
:info:build ../3rdparty/botan/botan.cpp:2495: error: unknown register name ‘%eax’ in ‘asm’
:info:build ../3rdparty/botan/botan.cpp: In function ‘void Botan::bigint_monty_redc(Botan::word*, size_t, const Botan::word*, size_t, Botan::word, Botan::word*)’:
:info:build ../3rdparty/botan/botan.cpp:2495: error: unknown register name ‘%edx’ in ‘asm’
:info:build ../3rdparty/botan/botan.cpp:2495: error: unknown register name ‘%eax’ in ‘asm’
:info:build {standard input}:28767:Invalid mnemonic 'rorl'
:info:build {standard input}:28768:Invalid mnemonic 'movl'
...

and lots more assembler related complaints caused by ../3rdparty/botan/botan.cpp are printed.

I am guessing this is due to some confusion on x86 assembler code which is not understood by ppc? What can I do?

Attachments (1)

main.log (654.2 KB) - added by udbraumann 4 years ago.

Download all attachments as: .zip

Change History (14)

Changed 4 years ago by udbraumann

Attachment: main.log added

comment:1 Changed 4 years ago by mf2k (Frank Schima)

Cc: michaelld@… removed
Owner: set to michaelld
Status: newassigned

comment:2 Changed 4 years ago by kencu (Ken)

The version of botan bundled in does not anticipate any arch other than an Intel system, it appears. There is lots of hard-coded assembly in there, and no real guards to consider a PPC machine that I can see.

There is an option to use a system botan but it expects version 1.10, and our current MacPorts version is in the 2.x range, so no idea if that might work. Doubt it though.

And I'll guess that even if you fixed up the botan assembly issue, you'll likely find other areas where an Intel processor was assumed, if it was assumed there.

I don't see any indication I ever installed qt4-qtcreator-mac on PPC... do you actually have it installed on PPC now? If so, I wonder how it ever installed ...

comment:3 Changed 4 years ago by udbraumann

Oh, I have it installed since years, last modification was 2017:

$ ls -al /Applications/MacPorts/Qt4
total 0
drwxr-xr-x  13 root  admin  442 Feb  7 02:29 .
drwxr-xr-x  11 root  admin  374 Apr 25 13:17 ..
drwxr-xr-x   3 root  admin  102 Feb  7 02:29 Assistant.app
drwxr-xr-x   3 root  admin  102 Feb  7 02:29 Designer.app
drwxr-xr-x   3 root  admin  102 Feb  7 02:29 Linguist.app
drwxr-xr-x   3 root  admin  102 Feb  7 02:29 QMLViewer.app
drwxr-xr-x   3 root  admin  102 Aug 21  2017 Qt Creator.app
drwxr-xr-x   3 root  admin  102 Feb  7 02:29 pixeltool.app
drwxr-xr-x   3 root  admin  102 Feb  7 02:29 qdbusviewer.app
drwxr-xr-x   3 root  admin  102 Feb  7 02:29 qhelpconverter.app
drwxr-xr-x   3 root  admin  102 Feb  7 02:29 qtconfig.app
drwxr-xr-x   3 root  admin  102 Feb  7 02:29 qtdemo.app
drwxr-xr-x   3 root  admin  102 Feb  7 02:29 qttracereplay.app

However, for some reason, presently not clear why exactly, the port qt4-creator-mac @2.8.1_2 is broken:

...
--->  Scanning binaries for linking errors
--->  Found 24 broken files, matching files to ports
--->  Found 3 broken ports, determining rebuild order
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt:
 qt4-creator-mac @2.8.1
 fontforge @20170731+python27
 openssh @7.6p1+kerberos5+xauth
Continue? [Y/n]: n
$

The last three ports presently do not build.

Qt Creator.app in fact launches, but issues an error message window telling that a lot of plugins cannot be loaded, all with an associated message (in German):

Das Plugin kann nicht geladen werden, weil eine Abhängigkeit nicht geladen werden konnte: CppTools(2.8.1)
Grund: Das Plugin kann nicht geladen werden, weil eine Abhängigkeit nicht geladen werden konnte: ProjectExplorer(2.8.1)
Grund: /Applications/MacPorts/Qt4/Qt Creator.app/Contents/PlugIns/QtProject/libProjectExplorer.dylib: Die Datei '/Applications/MacPorts/Qt4/Qt Creator.app/Contents/PlugIns/QtProject/libProjectExplorer.dylib' ist kein gültiges Qt-Plugin.

I.e., /Applications/MacPorts/Qt4/Qt Creator.app/Contents/PlugIns/QtProject/libProjectExplorer.dylib is no longer a valid Qt plugin, I think it has dependencies which are no longer existing, but which?

$ otool -L /Applications/MacPorts/Qt4/Qt\ Creator.app/Contents/PlugIns/QtProject/libProjectExplorer.dylib
/Applications/MacPorts/Qt4/Qt Creator.app/Contents/PlugIns/QtProject/libProjectExplorer.dylib:
	@rpath/PlugIns/QtProject/libProjectExplorer.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/PlugIns/QtProject/libLocator.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/PlugIns/QtProject/libFind.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/PlugIns/QtProject/libCore.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/PlugIns/QtProject/libTextEditor.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/PlugIns/libQtcSsh.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	@rpath/PlugIns/libExtensionSystem.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	@rpath/PlugIns/libUtils.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	@rpath/PlugIns/libAggregation.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 136.0.0)
	/opt/local/libexec/qt4/Library/Frameworks/QtDeclarative.framework/Versions/4/QtDeclarative (compatibility version 4.8.0, current version 4.8.7)
	/opt/local/libexec/qt4/Library/Frameworks/QtScript.framework/Versions/4/QtScript (compatibility version 4.8.0, current version 4.8.7)
	/opt/local/libexec/qt4/Library/Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
	/opt/local/libexec/qt4/Library/Frameworks/QtSvg.framework/Versions/4/QtSvg (compatibility version 4.8.0, current version 4.8.7)
	/opt/local/libexec/qt4/Library/Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.7)
	/opt/local/libexec/qt4/Library/Frameworks/QtSql.framework/Versions/4/QtSql (compatibility version 4.8.0, current version 4.8.7)
	/opt/local/libexec/qt4/Library/Frameworks/QtXmlPatterns.framework/Versions/4/QtXmlPatterns (compatibility version 4.8.0, current version 4.8.7)
	/opt/local/libexec/qt4/Library/Frameworks/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.7)
	/opt/local/libexec/qt4/Library/Frameworks/QtXml.framework/Versions/4/QtXml (compatibility version 4.8.0, current version 4.8.7)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.7)
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 34.0.0)

I see no broken dependency here, do you?

How can the system botan be invoked?

comment:4 Changed 4 years ago by kencu (Ken)

here's what broke it [bfd8d256cde2822dbc22ec681fd8414f397a518c/macports-ports]

Author: Chih-Hsuan Yen <yan12125@…> Date: Fri May 31 21:04:00 2019 +0800

qt4-creator-mac: use bundled botan 1.10

Incompatible with botan2

Ref: https://trac.macports.org/ticket/58513

comment:5 Changed 4 years ago by kencu (Ken)

OK, success

$ port -v installed | grep creator
  qt4-creator-mac @2.8.1_3 (active) platform='darwin 9' archs='ppc' date='2020-05-01T18:27:15-0700'

To make this work, I needed to resurrect the Botan 1.10 port, as botan1, and then change the qt4-creator-mac port, on powerpc at least, to use it instead of the bundled Botan.

It is a bit of hassle. I think I can move all this back into MacPorts, if acceptable to everyone -- should be, why not?

If you are impatient, you can set up my LeopardPorts repo as an overlay <https://github.com/kencu/LeopardPorts.git> and install it right now.

comment:6 in reply to:  5 ; Changed 4 years ago by udbraumann

Replying to kencu:

OK, success

You are great!!

$ port -v installed | grep creator
  qt4-creator-mac @2.8.1_3 (active) platform='darwin 9' archs='ppc' date='2020-05-01T18:27:15-0700'

Yesterday you were skeptic if it is possible at all, but the same day you could falsify yourself :-)

To make this work, I needed to resurrect the Botan 1.10 port, as botan1, and then change the qt4-creator-mac port, on powerpc at least, to use it instead of the bundled Botan.

Very good, I btw. have no access to some x86 based 10.5.8, so I can just speculate which other systems will benefit from your surgery.

It is a bit of hassle. I think I can move all this back into MacPorts, if acceptable to everyone -- should be, why not?

I sometimes have seen ports with some explicit version numbers inside their names, e.g. openssl10, so some botan1 would be some of these, say, level preserving ones.

If you are impatient, you can set up my LeopardPorts repo as an overlay <https://github.com/kencu/LeopardPorts.git> and install it right now.

Simple question, how to configure your site as temporal overlay?

BTW, I wonder if I sometimes could contribute with binary builds to the MacPorts repository, in our case to http://packages.macports.org/qt4-creator-mac, but I have no idea (i) how to assemble some (still fictive) qt4-creator-mac-2.8.1_3.darwin_9.ppc.tbz2 conforming some MacPorts standards, and (ii) how to upload or get eligible to do uploads? Others might benefit and often enough could save a lot of compiling time.

Last edited 4 years ago by udbraumann (previous) (diff)

comment:7 in reply to:  6 ; Changed 4 years ago by kencu (Ken)

Replying to udbraumann:

Yesterday you were skeptic if it is possible at all, but the same day you could falsify yourself :-)

Yes, I admit that when I saw the bundled Botan was so i386-specific, I wasn't optimistic that qt4-creator would build on PPC -- but then you showed me you did build it, so I was encouraged to try.

Simple question, how to configure your site as temporal overlay?

The general instructions on how to set up a local portfile repository are here <https://guide.macports.org/chunked/development.local-repositories.html>.

BTW, I wonder if I sometimes could contribute with binary builds to the MacPorts repository, in our case to http://packages.macports.org/qt4-creator-mac, but I have no idea (i) how to assemble some (still fictive) qt4-creator-mac-2.8.1_3.darwin_9.ppc.tbz2 conforming some MacPorts standards, and (ii) how to upload or get eligible to do uploads? Others might benefit and often enough could save a lot of compiling time.

MacPorts could not accept an uploaded package from a user. There are too many things that could go wrong. MacPorts has a big investment in security, and it relies on it's trusted reputation. So unless another PPC buildbot arrives, then we're stuck building ports.

comment:8 in reply to:  7 Changed 4 years ago by udbraumann

Replying to kencu:

Thanks a lot!

...

Simple question, how to configure your site as temporal overlay?

The general instructions on how to set up a local portfile repository are here <https://guide.macports.org/chunked/development.local-repositories.html>.

I finally managed to follow the instructions, i.e. have cloned your Git repository to a local folder, run portindex in that folder, have put an entry for that folder into my /opt/local/etc/macports/sources.conf, and then run sudo port selfupdate.

One small problem: for the "new" botan1 the distfile Botan-1.10.17.tgz is presently being searched under a non-existing branch http://distfiles.macports.org/botan1, but in fact is present under http://distfiles.macports.org/botan, so I manually downloaded the tgz to /opt/local/var/macports/distfiles/botan1.

comment:9 Changed 4 years ago by kencu (Ken)

yep, you got it!

I thought I fixed that botan1 distfile; I will check again.

comment:10 Changed 4 years ago by kencu (Ken)

I think I know why you had trouble downloading the distfile from the original source -- you are using a stock install of MacPorts that has no upgraded SSL capability, and so you likely couldn't get the file from the upstream server -- and it wasn't mirrored in the botan1 directory.

When you install MacPorts, it is built against the SSL system in /usr/lib -- which is ancient, and too old to be useful. Ryan mirrors all the distfiles on a server with very old security, so you can get them from there.

There is.a way to build MacPorts against a current SSL subsystem, which is what I do, and that avoids this issue.

comment:11 Changed 4 years ago by ken-cunningham-webuse

Resolution: fixed
Status: assignedclosed

In e954d7a88b117dc42deef1d29ad47a9e85e8d7ec/macports-ports (master):

qt4-creator-mac: use system botan1

qt4-creator-mac remains popular with the PPC crowd,
and the bundle botan is i386 only due to assembly.

build against a resurrected botan 1.10 version that
builds nicely on PPC

closes: #60418

comment:12 in reply to:  10 Changed 4 years ago by udbraumann

Replying to kencu:

I think I know why you had trouble downloading the distfile from the original source -- you are using a stock install of MacPorts that has no upgraded SSL capability, and so you likely couldn't get the file from the upstream server -- and it wasn't mirrored in the botan1 directory.

http://distfiles.macports.org/botan1 had not been existing yet the moment when I was doing the install. http://distfiles.macports.org should be and remain accessible using the - meanwhile - ancient ssl (including cyphers) shipped with 10.5.8, or am I wrong? But anyway, how could I add the mirror server with very old security you were mentioning to the list of mirrors? And where can I read about the way to build Macports against a current SSL subsystem? Years ago I published a way to manually replace the respective library in this forum, but was warned to do this, so I reversed my change back to the original.

comment:13 Changed 4 years ago by kencu (Ken)

So generally speaking a macports installation does not need to use the source files from <https://distfiles.macports.org>. The Portfile contains the full information to download the source code from the original URL. So if the source is missing from distfiles.macport.org, it makes no difference.

But it does to you, because you are on 10.5, and a stock MacPorts installation on 10.5 has very old TLS security capability, and most current source URLs, being https source URLs so malicious people don't get you to install crapola software instead of what you thought you were trying to install, most of these current source URLs will not work on your 10.5 macports installation. So you are unable to download any source code directly, and have to wait for the Portfile to be committed, and then one of Ryan's newer systems that does have current TLS security to download it for you from the original URL, and then mirror it in MacPorts distfiles.macports.org, which has downgraded the TLS security so that you can use it.

This works, but having downgraded TLS security is not ideal. But it is what it is, and that's why you only get your source code from the distfiles mirrors.

Better all around is to build macports against a current version of software with TLS security -- that's what I do. There is a configuration option in Macports to specify the curl version you want to build against. It uses the ancient system curl (2005 vintage) when you build it, but it uses a current curl (2020 vintage) when I build it.

The steps to go through are not complicated, but it's an extra few steps, and explaining it to people I guess is a bit tedious, so we have not required users to do that, so far at least.

As someone who develops Portfiles, my life would be a misery if I couldn't download anything.

Last edited 4 years ago by kencu (Ken) (previous) (diff)
Note: See TracTickets for help on using tickets.