Opened 3 years ago

Closed 2 years ago

#64588 closed defect (duplicate)

macports fails to build for ppc with gcc11: cregistry errors

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: base Version: 2.7.1
Keywords: powerpc, leopard Cc:
Port: macports

Description

Macports fails to build on 10.5.8 with gcc11:

===> staging to destroot in vendor/tclx
Installing header files in /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/include
 /usr/bin/install -c libtclx8.4.dylib /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/libtclx8.4.dylib
Installing ./generic/tclExtend.h
 : /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/libtclx8.4.dylib
 Install tclx.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/tclx.tcl
 Install autoload.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/autoload.tcl
 Install arrayprocs.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/arrayprocs.tcl
 Install compat.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/compat.tcl
 Install convlib.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/convlib.tcl
 Install edprocs.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/edprocs.tcl
 Install events.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/events.tcl
 Install forfile.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/forfile.tcl
 Install globrecur.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/globrecur.tcl
 Install help.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/help.tcl
 Install profrep.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/profrep.tcl
 Install pushd.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/pushd.tcl
 Install setfuncs.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/setfuncs.tcl
 Install showproc.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/showproc.tcl
 Install stringfile.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/stringfile.tcl
 Install tcllib.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/tcllib.tcl
 Install fmath.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/fmath.tcl
 Install buildhelp.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4/buildhelp.tcl
 Install pkgIndex.tcl /Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/lib/tclx8.4
===> making all in src
===> making all in src/compat
/opt/svacchanda/gcc11/bin/gcc -arch ppc -c -DUSE_TCL_STUBS -DTCL_NO_DEPRECATED -g -O2 -std=c99 -Wextra -Wall -pedantic  -DHAVE_CONFIG_H -I/Users/svacchanda/Downloads/MacPorts-2.7.1/src -I/Users/svacchanda/Downloads/MacPorts-2.7.1/src -I. -I/Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/include -fno-common getdelim.c -o getdelim.o
/opt/svacchanda/gcc11/bin/gcc -arch ppc -c -DUSE_TCL_STUBS -DTCL_NO_DEPRECATED -g -O2 -std=c99 -Wextra -Wall -pedantic  -DHAVE_CONFIG_H -I/Users/svacchanda/Downloads/MacPorts-2.7.1/src -I/Users/svacchanda/Downloads/MacPorts-2.7.1/src -I. -I/Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/include -fno-common getline.c -o getline.o
===> making all in src/cregistry
/opt/svacchanda/gcc11/bin/gcc -arch ppc -c -DUSE_TCL_STUBS -g -O2 -std=c99 -Wextra -Wall -pedantic   -DHAVE_CONFIG_H -I/Users/svacchanda/Downloads/MacPorts-2.7.1/src -I/Users/svacchanda/Downloads/MacPorts-2.7.1/src -I. -I/Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/include -D_XOPEN_SOURCE=600 -fno-common registry.c -o registry.o
/opt/svacchanda/gcc11/bin/gcc -arch ppc -c -DUSE_TCL_STUBS -g -O2 -std=c99 -Wextra -Wall -pedantic   -DHAVE_CONFIG_H -I/Users/svacchanda/Downloads/MacPorts-2.7.1/src -I/Users/svacchanda/Downloads/MacPorts-2.7.1/src -I. -I/Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/include -D_XOPEN_SOURCE=600 -fno-common entry.c -o entry.o
/opt/svacchanda/gcc11/bin/gcc -arch ppc -c -DUSE_TCL_STUBS -g -O2 -std=c99 -Wextra -Wall -pedantic   -DHAVE_CONFIG_H -I/Users/svacchanda/Downloads/MacPorts-2.7.1/src -I/Users/svacchanda/Downloads/MacPorts-2.7.1/src -I. -I/Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/include -D_XOPEN_SOURCE=600 -fno-common sql.c -o sql.o
/opt/svacchanda/gcc11/bin/gcc -arch ppc -c -DUSE_TCL_STUBS -g -O2 -std=c99 -Wextra -Wall -pedantic   -DHAVE_CONFIG_H -I/Users/svacchanda/Downloads/MacPorts-2.7.1/src -I/Users/svacchanda/Downloads/MacPorts-2.7.1/src -I. -I/Users/svacchanda/Downloads/MacPorts-2.7.1/vendor/vendor-destroot/opt/bootstrap/libexec/macports/include -D_XOPEN_SOURCE=600 -fno-common vercomp.c -o vercomp.o
vercomp.c: In function ‘vercmp’:
vercomp.c:68:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   68 |     if (lengthB < 0)
      |     ^~
vercomp.c:72:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   72 |         if(lengthA == lengthB && !strncmp(versionA, versionB, (size_t)lengthA))
      |         ^~
sql.c: In function ‘create_tables’:
sql.c:142:23: error: operator '>=' has no left operand
  142 | #if MP_SQLITE_VERSION >= 3022000
      |                       ^~
sql.c: In function ‘update_db’:
sql.c:316:23: error: operator '>=' has no left operand
  316 | #if MP_SQLITE_VERSION >= 3002000
      |                       ^~
sql.c:412:23: error: operator '>=' has no left operand
  412 | #if MP_SQLITE_VERSION >= 3003000
      |                       ^~
sql.c:637:23: error: operator '>=' has no left operand
  637 | #if MP_SQLITE_VERSION >= 3002000
      |                       ^~
sql.c:731:23: error: operator '>=' has no left operand
  731 | #if MP_SQLITE_VERSION >= 3022000
      |                       ^~
sql.c:752:23: error: operator '>=' has no left operand
  752 | #if MP_SQLITE_VERSION >= 3025000
      |                       ^~
entry.c: In function ‘reg_entry_open’:
entry.c:190:23: error: operator '>=' has no left operand
  190 | #if MP_SQLITE_VERSION >= 3006004
      |                       ^~
entry.c:196:23: error: operator '>=' has no left operand
  196 | #if MP_SQLITE_VERSION >= 3006004
      |                       ^~
entry.c: In function ‘reg_entry_installed’:
entry.c:515:23: error: operator '>=' has no left operand
  515 | #if MP_SQLITE_VERSION >= 3006004
      |                       ^~
entry.c: In function ‘reg_entry_owner’:
entry.c:546:23: error: operator '>=' has no left operand
  546 | #if MP_SQLITE_VERSION >= 3003013
      |                       ^~
entry.c:538:56: warning: unused parameter ‘cs’ [-Wunused-parameter]
  538 | int reg_entry_owner(reg_registry* reg, char* path, int cs, reg_entry** entry,
      |                                                    ~~~~^~
entry.c: In function ‘reg_entry_owner_id’:
make[2]: *** [sql.o] Error 1
make[2]: *** Waiting for unfinished jobs....
entry.c:613:23: error: operator '>=' has no left operand
  613 | #if MP_SQLITE_VERSION >= 3003013
      |                       ^~
entry.c:607:68: warning: unused parameter ‘cs’ [-Wunused-parameter]
  607 | sqlite_int64 reg_entry_owner_id(reg_registry* reg, char* path, int cs) {
      |                                                                ~~~~^~
entry.c: In function ‘reg_entry_unmap’:
entry.c:891:23: error: operator '>=' has no left operand
  891 | #if MP_SQLITE_VERSION >= 3006004
      |                       ^~
entry.c: In function ‘reg_entry_activate’:
entry.c:1096:23: error: operator '>=' has no left operand
 1096 | #if MP_SQLITE_VERSION >= 3006004
      |                       ^~
entry.c: In function ‘reg_entry_deactivate’:
entry.c:1205:23: error: operator '>=' has no left operand
 1205 | #if MP_SQLITE_VERSION >= 3006004
      |                       ^~
registry.c: In function ‘reg_checkpoint’:
registry.c:519:34: warning: unused parameter ‘reg’ [-Wunused-parameter]
  519 | int reg_checkpoint(reg_registry* reg, reg_error* errPtr) {
      |                    ~~~~~~~~~~~~~~^~~
registry.c:519:50: warning: unused parameter ‘errPtr’ [-Wunused-parameter]
  519 | int reg_checkpoint(reg_registry* reg, reg_error* errPtr) {
      |                                       ~~~~~~~~~~~^~~~~~
make[2]: *** [entry.o] Error 1
make[1]: *** [all] Error 1
make: *** [all] Error 1
  1. S. For the record, building on 10.6 PPC fails with the same errors.

Attachments (1)

config.log (62.7 KB) - added by barracuda156 3 years ago.
Config log when trying to build with gcc11

Download all attachments as: .zip

Change History (8)

comment:1 Changed 3 years ago by barracuda156

To be clear, this is not Macports gcc11 (which does not build on PowerPC, as of Feb 2022):

36-47:MacPorts-2.7.1 svacchanda$ /opt/svacchanda/gcc11/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/opt/svacchanda/gcc11/bin/gcc
COLLECT_LTO_WRAPPER=/opt/svacchanda/gcc11/libexec/gcc/powerpc-apple-darwin9/11.2.1/lto-wrapper
Target: powerpc-apple-darwin9
Configured with: ../configure --prefix=/opt/svacchanda/gcc11 --build=powerpc-apple-darwin9 --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=all CC=/opt/iains/powerpc-apple-darwin9/gcc-10-3-ppc/bin/gcc CXX=/opt/iains/powerpc-apple-darwin9/gcc-10-3-ppc/bin/g++
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.1 20211013 (GCC)

comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

The MacPorts configure script was supposed to have defined MP_SQLITE_VERSION to be the SQLite version number. Can you figure out why it didn't do that? What does the config.log say about it?

Changed 3 years ago by barracuda156

Attachment: config.log added

Config log when trying to build with gcc11

comment:3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Because on some OS/Xcode versions the SQLite version in the header (in the SDK) may be newer than the library actually installed on the OS, MacPorts checks both the version in the header and the version in the library and uses the earlier one. In your case it found an empty version in the header, which is surprising:

configure:8214: checking for SQLite version in header
configure:8239: /opt/svacchanda/gcc11/bin/gcc -arch ppc -E   conftest.c
configure:8239: $? = 0
configure:8251: result:

If it had not found the header, or the header did not have SQLITE_VERSION_NUMBER in it, then it would have errored, but it appears to have found the header, and the header appears to have defined SQLITE_VERSION_NUMBER to be empty. MacPorts then checked the library and found a sensible version number:

configure:8255: checking for SQLite version at runtime
configure:8283: /opt/svacchanda/gcc11/bin/gcc -arch ppc -o conftest -g -O2    -lsqlite3 conftest.c  >&5
configure:8283: $? = 0
configure:8283: ./conftest
configure:8283: $? = 0
configure:8296: result: 3004000

It then apparently decided that the empty version in the header was perhaps equivalent to 0 and therefore earlier than the 3004000 version in the library and kept the empty version from the header, which of course failed to be a valid number later.

Can you check your sqlite3.h file and see what it says about SQLITE_VERSION_NUMBER?

Last edited 3 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:4 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Specifically try:

echo '#include <sqlite3.h>' | /opt/svacchanda/gcc11/bin/gcc -arch ppc -E -dM - | fgrep SQLITE_VERSION_NUMBER

comment:5 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

I think this is a duplicate of #63074 which has already been fixed in macports-base master but not in any released version of MacPorts. So try using master instead.

comment:6 in reply to:  4 Changed 3 years ago by barracuda156

Replying to ryandesign:

Specifically try:

echo '#include <sqlite3.h>' | /opt/svacchanda/gcc11/bin/gcc -arch ppc -E -dM - | fgrep SQLITE_VERSION_NUMBER
36-47:~ svacchanda$ echo '#include <sqlite3.h>' | /opt/svacchanda/gcc11/bin/gcc -arch ppc -E -dM - | fgrep SQLITE_VERSION_NUMBER
#define SQLITE_VERSION_NUMBER 3004000
  1. S. By master version do you mean Git one?
Last edited 3 years ago by barracuda156 (previous) (diff)

comment:7 Changed 2 years ago by jmroot (Joshua Root)

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.