I'm trying to update postgresql, but all versions (mips and ~mips) fail to compile - including the version I already have installed! The only reason I can think of that the installed version would not fail to compile is that I recently (mistakenly) upgraded a ~mips version of binutils. I've now reverted back to binutils-2.15.91.0.2-r1, but this doesn't seem to help. The error message with the older binutils is slightly different - but still in the same file and the same linking problems. Possibly I was using an older ~mips that worked, but the fact that the stable version apparently fails is of concern... Error message: make[4]: Leaving directory `/usr/tmp/portage/postgresql-7.4.7-r1/work/postgresql-7.4.7/src/backend/utils/mb' mips-unknown-linux-gnu-ld -r -o SUBSYS.o fmgrtab.o adt/SUBSYS.o cache/SUBSYS.o error/SUBSYS.o fmgr/SUBSYS.o hash/SUBSYS.o init/SUBSYS.o misc/SUBSYS.o mmgr/SUBSYS.o sort/SUBSYS.o time/SUBSYS.o mb/SUBSYS.o make[3]: Leaving directory `/usr/tmp/portage/postgresql-7.4.7-r1/work/postgresql-7.4.7/src/backend/utils' mips-unknown-linux-gnu-gcc -O2 -march=mips4 -mtune=r5k -mabi=32 -pipe -I/usr/include/libxml2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations -L../../src/port -Wl,-rpath,/usr/lib -Wl,-E access/SUBSYS.o bootstrap/SUBSYS.o catalog/SUBSYS.o parser/SUBSYS.o commands/SUBSYS.o executor/SUBSYS.o lib/SUBSYS.o libpq/SUBSYS.o main/SUBSYS.o nodes/SUBSYS.o optimizer/SUBSYS.o port/SUBSYS.o postmaster/SUBSYS.o regex/SUBSYS.o rewrite/SUBSYS.o storage/SUBSYS.o tcop/SUBSYS.o utils/SUBSYS.o -lpam -lssl -lcrypto -lz -lreadline -lcrypt -lresolv -lnsl -ldl -lm -lbsd -lpgport -o postgres access/SUBSYS.o(.text+0x2ffec): In function `GetRedoRecPtr': : undefined reference to `tas' access/SUBSYS.o(.text+0x30bf0): In function `XLogWrite': : undefined reference to `tas' access/SUBSYS.o(.text+0x30c88): In function `XLogWrite': : undefined reference to `tas' access/SUBSYS.o(.text+0x30fb0): In function `XLogWrite': : undefined reference to `tas' access/SUBSYS.o(.text+0x313dc): In function `AdvanceXLInsertBuffer': : undefined reference to `tas' access/SUBSYS.o(.text+0x31668): more undefined references to `tas' follow collect2: ld returned 1 exit status make[2]: *** [postgres] Error 1 make[2]: Leaving directory `/usr/tmp/portage/postgresql-7.4.7-r1/work/postgresql-7.4.7/src/backend' make[1]: *** [all] Error 2 make[1]: Leaving directory `/usr/tmp/portage/postgresql-7.4.7-r1/work/postgresql-7.4.7/src' make: *** [all] Error 2 !!! ERROR: dev-db/postgresql-7.4.7-r1 failed. !!! Function src_compile, Line 138, Exitcode 2 !!! (no error message) emerge info: Portage 2.0.51.19 (default-linux/mips/mips64/2005.0, gcc-3.4.3, glibc-2.3.4.20040619-r2, 2.6.10-mips-r1 mips64) ================================================================= System uname: 2.6.10-mips-r1 mips64 R5000 V2.1 FPU V1.0 Gentoo Base System version 1.4.16 Python: dev-lang/python-2.3.4-r1 [2.3.4 (#1, Apr 7 2005, 17:52:50)] ccache version 2.3 [enabled] dev-lang/python: 2.3.4-r1 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.5, 1.6.3, 1.4_p6, 1.8.5-r3, 1.7.9-r1, 1.9.4 sys-devel/binutils: 2.15.91.0.2-r1 sys-devel/libtool: 1.5.10-r4 virtual/os-headers: 2.4.21-r3 ACCEPT_KEYWORDS="mips" AUTOCLEAN="yes" CFLAGS="-O2 -march=mips4 -mtune=r5k -mabi=32 -pipe" CHOST="mips-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=mips4 -mtune=r5k -mabi=32 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks userpriv" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/usr/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="mips X bash-completion berkdb bitmap-fonts bzip2 caps crypt cscope curl fam fortran freetds gdbm gpm gtk gtk2 ipv6 jpeg kerberos ldap libwww mcal mysql ncurses nls odbc opengl pam pcre pdflib perl pic png postgres python readline sasl sdl skey slang snmp socks5 spell ssl tcltk tcpd test threads tiff truetype truetype-fonts type1-fonts unicode userlocales xml2 xprint zlib" Unset: ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS
FYI http://thread.gmane.org/gmane.os.netbsd.devel.packages/6068
Please emerge with CFLAGS="-O2" and tell me results.
Please report your /usr/tmp/portage/postgresql-7.4.7-r1/work/postgresql-7.4.7/src/include/pg_config.h
Hi Stuart, nigoro who has the same kind of machine as yours has told me that it works with not -O[2-9] but -O1. Can you try compiling it with -O1 flag? Then, I'll add replace_flag function to postgresql ebuilds after your test.
This problem seems to be related to gcc-3.4.x. When it compiled using gcc-3.3.2, it has compiled normally.
Created attachment 55995 [details, diff] patch for postgresql-7.4.7-r1.ebuild This patch is for gcc-3.4.x. The problem which cannot be compiled, and it which initdb doesn't work are solved by applying the patch. * "-fno-unit-at-a-time" is required in order to make compile successful. * And "-fno-merge-constants" is required in order to work normally. Stuart, Would you try this patch and tell me results ? FYI, the following is the result of initdb when compiling without "-fno-merge-constants". # su postgres -c "/usr/bin/initdb --pgdata /tmp/hoge" The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale C. creating directory /tmp/hoge... ok creating directory /tmp/hoge/base... ok creating directory /tmp/hoge/global... ok creating directory /tmp/hoge/pg_xlog... ok creating directory /tmp/hoge/pg_clog... ok selecting default max_connections... /usr/bin/initdb: line 572: 30037 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 572: 30039 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 572: 30041 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 572: 30043 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 572: 30045 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 572: 30047 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 10 selecting default shared_buffers... /usr/bin/initdb: line 585: 30048 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 585: 30049 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 585: 30050 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 585: 30051 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 585: 30052 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 585: 30053 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 585: 30054 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 585: 30055 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 585: 30056 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 585: 30057 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 /usr/bin/initdb: line 585: 30058 Segmentation fault "$PGPATH"/postgres -boot -x0 $TEST_OPT template1 </dev/null >/dev/null 2>&1 50 creating configuration files... ok creating template1 database in /tmp/hoge/base/1... /usr/bin/initdb: line 644: 30134 Segmentation fault "$PGPATH"/postgres -boot -x1 $PGSQL_OPT $BOOTSTRAP_TALK_ARG template1 initdb: failed initdb: removing data directory "/tmp/hoge"
The result of regression test of PostgreSQL. /bin/sh ./pg_regress --schedule=./serial_schedule --multibyte=SQL_ASCII (using postmaster on Unix socket, default port) ============== dropping database "regression" ============== DROP DATABASE ============== creating database "regression" ============== CREATE DATABASE ALTER DATABASE ============== dropping regression test user accounts ============== ============== installing PL/pgSQL ============== ============== running regression test queries ============== <snip> test oidjoins ... ok test type_sanity ... ok test opr_sanity ... ok test geometry ... FAILED test horology ... ok test insert ... ok test create_function_1 ... ok <snip> ======================= 1 of 93 tests failed. ======================= The differences that caused some tests to fail can be viewed in the file `./regression.diffs'. A copy of the test summary that you see above is saved in the file `./regression.out'. make[2]: *** [installcheck] Error 1 rm regress.o make[2]: Leaving directory `/var/tmp/portage/postgresql-7.4.7-r1/work/postgresql-7.4.7/src/test/regress' make[1]: *** [installcheck] Error 2 make[1]: Leaving directory `/var/tmp/portage/postgresql-7.4.7-r1/work/postgresql-7.4.7/src/test' make: *** [installcheck] Error 2
Created attachment 55996 [details] regression.out
Created attachment 55997 [details] regression.diffs
MIPS herds, How do you think about these results ?
Okay, with the patch everything looks good to me: # ebuild /var/db/pkg/dev-db/postgresql-7.4.7-r1/postgresql-7.4.7-r1.ebuild config * Creating the data directory ... * Initializing the database ... The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale C. fixing permissions on existing directory /var/lib/postgresql/data... ok creating directory /var/lib/postgresql/data/base... ok creating directory /var/lib/postgresql/data/global... ok creating directory /var/lib/postgresql/data/pg_xlog... ok creating directory /var/lib/postgresql/data/pg_clog... ok selecting default max_connections... 100 selecting default shared_buffers... 1000 creating configuration files... ok creating template1 database in /var/lib/postgresql/data/base/1... ok initializing pg_shadow... ok enabling unlimited row size for system tables... ok initializing pg_depend... ok creating system views... ok loading pg_description... ok creating conversions... ok setting privileges on built-in objects... ok creating information schema... ok vacuuming database template1... ok copying template1 to template0... ok Success. ... but I've not had a chance to give it an in-depth test yet. Those regression test results are *only* for compilations with "-fno-merge-constants", right?
Stuart, Thanks for your report! I tested using PostgreSQL compiled after applying my patch. Regression test is possible by the following methods. 1. /etc/init.d/postgresql start 2. cd /usr/portage/dev-db/postgresql 3. ebuild postgresql-7.4.7-r1.ebuild compile 4. cd /var/tmp/portage/postgresql-7.4.7-r1/work 5. Please download postgresql-test-7.4.7.tar.bz2 from following URL. http://www.postgresql.org/ftp/source/v7.4.7/ 6. tar xjpf postgresql-test-7.4.7.tar.bz2 7. chmod -R 777 /var/tmp/portage/postgresql-7.4.7-r1/work 8. cd /var/tmp/portage/postgresql-7.4.7-r1/work/postgresql-7.4.7 9. su postgres 10. make installcheck Thank you.
Created attachment 61044 [details, diff] safer patch for postgresql-7.4.7-r2.ebuild It makes all optimization disable. I think that it is safe rather than disable a part of optimization.
MIPS herds, Would you test this patch ?
(In reply to comment #13) You cannot do it like that. Use flag filtering functions instead.
(In reply to comment #5) > This problem seems to be related to gcc-3.4.x. > When it compiled using gcc-3.3.2, it has compiled normally. Reopen if you can reproduce w/ >=gcc4.1.1-r3; gcc-3.x is not supported any more. Thanks.